~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Alexander Belchenko
  • Date: 2007-11-26 08:54:41 UTC
  • mto: This revision was merged to the branch mainline in revision 3032.
  • Revision ID: bialix@ukr.net-20071126085441-lx9pwr0gcahikyp4
Martin's review.

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)