~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-05-18 18:20:31 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070518182031-gbg2cgidv5l20x9p
Takes Robert comments into account.

* bzrlib/transport/ftp.py:
(FtpTransport.__init__): Write a better explanation.

* bzrlib/tests/test_init.py:
(InstrumentedTransport): Just make hooks a class attribute.
(InstrumentedTransport._get_FTP): Run hook directly in the for
loop.
(TransportHooks.run_hook, TransportHooks.uninstall_hook): Not
needed. The hooks should be cleaned up by the test itself.
(TestInit.setUp.cleanup): Resset to default hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
    # at least return windows root directory
170
170
    windir = os.environ.get('windir')
171
171
    if windir:
172
 
        return os.path.splitdrive(windir)[0] + '/'
 
172
        return os.path.splitdrive(windir) + '/'
173
173
    # otherwise C:\ is good enough for 98% users
174
174
    return 'C:/'
175
175
 
238
238
 
239
239
def get_host_name_unicode():
240
240
    return _ensure_unicode(get_host_name())
241
 
 
242
 
 
243
 
def glob_expand(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