module win_installer.win_helper
¶
Short summary¶
module pymyinstall.win_installer.win_helper
Helpers, inspired from utils.py
Functions¶
function |
truncated documentation |
---|---|
Create Windows shortcut (.lnk file) |
|
Convert string from file system charset to unicode |
|
Execute a script (get-pip typically) |
|
Execute shell command (args is a list of arguments) in path |
|
Return HKCU/HKLM environment variable name and value |
|
Return version of the GCC compiler installed in path |
|
Return version of the Julia installed in path |
|
Return (version, architecture) for the Python distribution located in path. The version number is limited to MAJOR.MINOR, … |
|
Return long version (X.Y.Z) for the Python distribution located in path |
|
Return version of the R installed in path |
|
Return a tuple (name, version) of the Python source package |
|
Remove absolute path to python.exe in shebang lines. |
|
Replace a string in a source file |
|
Replace the middle of lines between in_line_start and endline |
|
Execute Python command using the Python interpreter located in path |
|
Register a Python distribution in Windows registry |
|
Set HKCU/HKLM environment variables |
Documentation¶
Helpers, inspired from utils.py
- pymyinstall.win_installer.win_helper.create_shortcut(path, description, filename, arguments='', workdir='', iconpath='', iconindex=0)¶
Create Windows shortcut (.lnk file)
- Parameters:
path – where to store the link
description – description
filename – link name
arguments – arguments to store
workdir – working directory
@para iconpath icon
- Parameters:
iconindex – icon index
- Returns:
filename
- pymyinstall.win_installer.win_helper.decode_fs_string(string)¶
Convert string from file system charset to unicode
- pymyinstall.win_installer.win_helper.do_script(this_script, python_exe=None, verbose=False, install_options=None)¶
Execute a script (get-pip typically)
- pymyinstall.win_installer.win_helper.exec_shell_cmd(args, path)¶
Execute shell command (args is a list of arguments) in path
- pymyinstall.win_installer.win_helper.get_env(name, current=True)¶
Return HKCU/HKLM environment variable name and value
- Parameters:
name – name to look for
current – switch between HKEY_CURRENT_USER (True) and HKEY_LOCAL_MACHINE (False)
- Returns:
tuple (see below)
For example, get_user_env(‘PATH’) may returns:
('Path', u'C:\Program Files\Intel\WiFi\bin\')
- pymyinstall.win_installer.win_helper.get_gcc_version(path)¶
Return version of the GCC compiler installed in path
- pymyinstall.win_installer.win_helper.get_julia_version(path)¶
Return version of the Julia installed in path
- pymyinstall.win_installer.win_helper.get_python_infos(path)¶
Return (version, architecture) for the Python distribution located in path. The version number is limited to MAJOR.MINOR, the architecture is an integer: 32 or 64
- pymyinstall.win_installer.win_helper.get_python_long_version(path)¶
Return long version (X.Y.Z) for the Python distribution located in path
- pymyinstall.win_installer.win_helper.get_r_version(path)¶
Return version of the R installed in path
- pymyinstall.win_installer.win_helper.get_source_package_infos(fname)¶
Return a tuple (name, version) of the Python source package
- pymyinstall.win_installer.win_helper.patch_shebang_line(fname, pad=b' ', fLOG=<built-in function print>)¶
Remove absolute path to python.exe in shebang lines.
- Parameters:
python – python extractor
pad – pad
fLOG – logging function
- Returns:
boolean, True if patched, False otherwise
- pymyinstall.win_installer.win_helper.patch_sourcefile(fname, in_text, out_text, silent_mode=False)¶
Replace a string in a source file
- pymyinstall.win_installer.win_helper.patch_sourcelines(fname, in_line_start, out_line, endline='\n', silent_mode=False)¶
Replace the middle of lines between in_line_start and endline
- pymyinstall.win_installer.win_helper.python_query(cmd, path)¶
Execute Python command using the Python interpreter located in path
- pymyinstall.win_installer.win_helper.register(target, current=True)¶
Register a Python distribution in Windows registry
- pymyinstall.win_installer.win_helper.set_env(name, value, current=True)¶
Set HKCU/HKLM environment variables
- Parameters:
name – name to look for
current – switch between HKEY_CURRENT_USER (True) and HKEY_LOCAL_MACHINE (False)