eric7.SystemUtilities.OSUtilities

Module implementing Operating System related utility functions.

Global Attributes

None

Classes

None

Functions

_getFolderPath Function to get the path of the named folder from the Windows registry.
createWindowsShortcut Create Windows shortcut.
getAutostartPath Function to get the path to the 'Autostart' folder.
getDesktopPath Function to get the path to the 'Desktop' folder.
getEnvironmentEntry Module function to get an environment entry.
getHomeDir Function to get a users home directory.
getProgramsPath Function to get the path to the 'Programs' folder.
getRealName Function to get the real name of the user.
getUserName Function to get the user name.
getWinregEntry Function to get an entry from the Windows Registry.
hasEnvironmentEntry Module function to check, if the environment contains an entry.
isFreeBsdPlatform Function to check, if this is a BSD (FreeBSD) platform.
isLinuxPlatform Function to check, if this is a Linux platform.
isMacPlatform Function to check, if this is a Mac platform.
isWindowsPlatform Function to check, if this is a Windows platform.
win32_GetUserName Function to get the user name under Win32.
win32_Kill Function to provide an os.kill equivalent for Win32.
win32_getRealName Function to get the user's real name (aka.


_getFolderPath

_getFolderPath(name)

Function to get the path of the named folder from the Windows registry.

name (str)
folder name
Return:
folder path (None in case there is no such folder)
Return Type:
str | None
Up


createWindowsShortcut

createWindowsShortcut(linkPath, targetPath, iconPath)

Create Windows shortcut.

linkPath (str)
path of the shortcut file
targetPath (str)
path the shortcut shall point to
iconPath (str)
path of the icon file
Up


getAutostartPath

getAutostartPath()

Function to get the path to the 'Autostart' folder.

Return:
path to the 'Autostart' folder
Return Type:
str | None
Up


getDesktopPath

getDesktopPath()

Function to get the path to the 'Desktop' folder.

Return:
path to the 'Desktop' folder
Return Type:
str | None
Up


getEnvironmentEntry

getEnvironmentEntry(key, default=None)

Module function to get an environment entry.

key (str)
key of the requested environment entry
default (str)
value to be returned, if the environment doesn't contain the requested entry
Return:
the requested entry or the default value, if the entry wasn't found
Return Type:
str
Up


getHomeDir

getHomeDir()

Function to get a users home directory.

Return:
home directory
Return Type:
str
Up


getProgramsPath

getProgramsPath()

Function to get the path to the 'Programs' folder.

Return:
path to the 'Programs' folder
Return Type:
str | None
Up


getRealName

getRealName()

Function to get the real name of the user.

Return:
real name of the user
Return Type:
str
Up


getUserName

getUserName()

Function to get the user name.

Return:
user name
Return Type:
str
Up


getWinregEntry

getWinregEntry(name, path)

Function to get an entry from the Windows Registry.

name (str)
variable name
path (str)
registry path of the variable
Return:
value of requested registry variable
Return Type:
Any
Up


hasEnvironmentEntry

hasEnvironmentEntry(key)

Module function to check, if the environment contains an entry.

key (str)
key of the requested environment entry
Return:
flag indicating the presence of the requested entry
Return Type:
bool
Up


isFreeBsdPlatform

isFreeBsdPlatform()

Function to check, if this is a BSD (FreeBSD) platform.

Return:
flag indicating BSD platform
Return Type:
bool
Up


isLinuxPlatform

isLinuxPlatform()

Function to check, if this is a Linux platform.

Return:
flag indicating Linux platform
Return Type:
bool
Up


isMacPlatform

isMacPlatform()

Function to check, if this is a Mac platform.

Return:
flag indicating Mac platform
Return Type:
bool
Up


isWindowsPlatform

isWindowsPlatform()

Function to check, if this is a Windows platform.

Return:
flag indicating Windows platform
Return Type:
bool
Up


win32_GetUserName

win32_GetUserName()

Function to get the user name under Win32.

Return:
user name
Return Type:
str
Up


win32_Kill

win32_Kill(pid)

Function to provide an os.kill equivalent for Win32.

pid (int)
process id
Return:
result of the kill
Return Type:
bool
Up


win32_getRealName

win32_getRealName()

Function to get the user's real name (aka. display name) under Win32.

Return:
real name of the current user
Return Type:
str
Up