##// END OF EJS Templates
windows: hoist expand_glob() back into util.py...
Steve Borho -
r7913:1b1b3dd6 default
parent child Browse files
Show More
@@ -844,6 +844,19 b' class path_auditor(object):'
844
844
845 if os.name == 'nt':
845 if os.name == 'nt':
846 from windows import *
846 from windows import *
847 def expand_glob(pats):
848 '''On Windows, expand the implicit globs in a list of patterns'''
849 ret = []
850 for p in pats:
851 kind, name = patkind(p, None)
852 if kind is None:
853 globbed = glob.glob(name)
854 if globbed:
855 ret.extend(globbed)
856 continue
857 # if we couldn't expand the glob, just keep it around
858 ret.append(p)
859 return ret
847 else:
860 else:
848 from posix import *
861 from posix import *
849
862
@@ -229,20 +229,6 b' def getuser():'
229 raise Abort(_('user name not available - set USERNAME '
229 raise Abort(_('user name not available - set USERNAME '
230 'environment variable'))
230 'environment variable'))
231
231
232 def expand_glob(pats):
233 '''On Windows, expand the implicit globs in a list of patterns'''
234 ret = []
235 for p in pats:
236 kind, name = patkind(p, None)
237 if kind is None:
238 globbed = glob.glob(name)
239 if globbed:
240 ret.extend(globbed)
241 continue
242 # if we couldn't expand the glob, just keep it around
243 ret.append(p)
244 return ret
245
246 def username(uid=None):
232 def username(uid=None):
247 """Return the name of the user with the given uid.
233 """Return the name of the user with the given uid.
248
234
General Comments 0
You need to be logged in to leave comments. Login now