~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-04-30 06:54:40 UTC
  • mfrom: (3380.1.16 make-it-right)
  • Revision ID: pqm@pqm.ubuntu.com-20080430065440-1l8693padc4f7uho
(abentley) Fix fetch from non-rich-root to rich-root

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    else:
65
65
        create_buffer = ctypes.create_unicode_buffer
66
66
        suffix = 'W'
 
67
try:
 
68
    import win32file
 
69
    has_win32file = True
 
70
except ImportError:
 
71
    has_win32file = False
67
72
 
68
73
 
69
74
# Special Win32 API constants
319
324
        _winreg.CloseKey(hkey)
320
325
 
321
326
    return fullpath
 
327
 
 
328
 
 
329
def set_file_attr_hidden(path):
 
330
    """Set file attributes to hidden if possible"""
 
331
    if has_win32file:
 
332
        win32file.SetFileAttributes(path, win32file.FILE_ATTRIBUTE_HIDDEN)