Package moul :: Package osdependent :: Package win32 :: Module winpath
[hide private]
[frames] | no frames]

Module winpath



Functions for getting system/language/user dependent paths on windows.

All path names returned by the functions of this module are unicode strings.

From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473846/

Functions [hide private]
  _substenv(m)
  expandvars(s)
Expand environment variables of form %var%.
  _get_reg_value(key, subkey, name)
Return registry value specified by key, subkey, and name.
  _get_reg_user_value(key, name)
Return a windows registry value from the CURRENT_USER branch.
  _get_reg_machine_value(key, name)
Return a windows registry value from the LOCAL_MACHINE branch.
  get_appdata()
Return path of directory where apps should store user specific data.
  get_common_shellfolders()
Return mapping of shell folder names (all users) to paths.
  get_homedir()
Return path to user home directory, i.e.
  get_sharedconf(prog, *args)
Return path to shared configuration data for 'prog' from 'vendor'.
  get_shellfolders(branch=HKCU, key=SHELL_FOLDERS)
Return mapping of shell folder names (current user) to paths.
  get_userconf(vendor, prog, *args)
Return path to user configuration data for 'prog' from 'vendor'.
  get_windir()
Convenience function to get path to windows installation directory.

Variables [hide private]
  __module__ = "winpaths"
  __author__ = "Christopher Arndt"
  __version__ = "0.1"
  __revision__ = "$Rev: 122 $"
  __date__ = "$Date$"
  __copyright__ = "Python license"
  SHELL_FOLDERS = r'Software\Microsoft\Windows\CurrentVersion\Explorer...
  USER_SHELL_FOLDERS = r'Software\Microsoft\Windows\CurrentVersion\Explorer...
  HKCU = _winreg.HKEY_CURRENT_USER
  HKLM = _winreg.HKEY_LOCAL_MACHINE
  _env_rx = None
helper for pickle

Function Details [hide private]

_substenv(m)

 
None

expandvars(s)

 

Expand environment variables of form %var%.

Unknown variables are left unchanged.

_get_reg_value(key, subkey, name)

 

Return registry value specified by key, subkey, and name.

Environment variables in values of type REG_EXPAND_SZ are expanded if possible.

_get_reg_user_value(key, name)

 
Return a windows registry value from the CURRENT_USER branch.

_get_reg_machine_value(key, name)

 
Return a windows registry value from the LOCAL_MACHINE branch.

get_appdata()

 
Return path of directory where apps should store user specific data.

get_common_shellfolders()

 
Return mapping of shell folder names (all users) to paths.

get_homedir()

 
Return path to user home directory, i.e. 'My Files'.

get_sharedconf(prog, *args)

 

Return path to shared configuration data for 'prog' from 'vendor'.

Additional arguments are appended via os.path.join().

See also: get_user_conf()

get_shellfolders(branch=HKCU, key=SHELL_FOLDERS)

 
Return mapping of shell folder names (current user) to paths.

get_userconf(vendor, prog, *args)

 

Return path to user configuration data for 'prog' from 'vendor'.

Additional arguments are appended via os.path.join(), e.g. use like this:

optionsfn = get_userconf("ACME Soft", "Exploder", "Options.xml")

get_windir()

 
Convenience function to get path to windows installation directory.

Variables Details [hide private]

__module__

None
Value:
"winpaths"                                                             
      

__author__

None
Value:
"Christopher Arndt"                                                    
      

__version__

None
Value:
"0.1"                                                                  
      

__revision__

None
Value:
"$Rev: 122 $"                                                          
      

__date__

None
Value:
"$Date$"                                                               
      

__copyright__

None
Value:
"Python license"                                                       
      

SHELL_FOLDERS

None
Value:
r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'    
      

USER_SHELL_FOLDERS

None
Value:
r'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folder
s'                                                                     
      

HKCU

None
Value:
_winreg.HKEY_CURRENT_USER                                              
      

HKLM

None
Value:
_winreg.HKEY_LOCAL_MACHINE                                             
      

_env_rx

helper for pickle
Value:
None