/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: John Arbash Meinel
  • Date: 2007-07-11 23:45:20 UTC
  • mfrom: (2601 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2643.
  • Revision ID: john@arbash-meinel.com-20070711234520-do3h7zw8skbathpz
[merge] bzr.dev 2601

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
 
239
239
def get_host_name_unicode():
240
240
    return _ensure_unicode(get_host_name())
 
241
 
 
242
 
 
243
def glob_expand_for_win32(file_list):
 
244
    """Replacement for glob expansion by the shell.
 
245
 
 
246
    Win32's cmd.exe does not do glob expansion (eg ``*.py``), so we do our own
 
247
    here.
 
248
 
 
249
    :param file_list: A list of filenames which may include shell globs.
 
250
    :return: An expanded list of filenames.
 
251
 
 
252
    Introduced in bzrlib 0.18.
 
253
    """
 
254
    if not file_list:
 
255
        return []
 
256
    import glob
 
257
    expanded_file_list = []
 
258
    for possible_glob in file_list:
 
259
        glob_files = glob.glob(possible_glob)
 
260
 
 
261
        if glob_files == []:
 
262
            # special case to let the normal code path handle
 
263
            # files that do not exists
 
264
            expanded_file_list.append(possible_glob)
 
265
        else:
 
266
            expanded_file_list += glob_files
 
267
    return expanded_file_list
 
268
 
 
269