Constants¶
Provides constants, defaults and the ability to load configs or overwrite defaults for a specific configuration.
-
constants.
ASKROOT
= True¶ True, if uberdot shall ask for root permission if needed. If False, uberdot will fail if root permission is needed. Default is
True
.
-
constants.
BACKUP_EXTENSION
= 'bak'¶ The extension that will be used for backup files. Default is
bak
.
-
constants.
BOLD
= '\x1b[1m'¶ Bash color code for bold text.
-
constants.
CFG_FILES
= []¶ A list with all configuration files that will be used to set constants. All settings of all configuration files will be used. If a specific setting is set in more than one configuration file, the setting from the configuration file with higher index will be prefered.
-
constants.
COLOR
= True¶ True, if output should be colored. Default is
True
.
-
constants.
CONFIG_SEARCH_PATHS
= ['/etc/uberdot', '/home/travis/.config/uberdot', '/home/travis/build/schuerik/uberdot/data']¶ A list of paths that will be used to search for configuration files.
-
constants.
C_DEBUG
= '\x1b[90m'¶ Bash color code for debugging output (gray).
-
constants.
C_FAIL
= '\x1b[91m'¶ Bash color code for error output (red).
-
constants.
C_HIGHLIGHT
= '\x1b[34m'¶ Bash color code for highlighting normal output (blue).
-
constants.
C_OK
= '\x1b[92m'¶ Bash color code for successful output (green).
-
constants.
C_WARNING
= '\x1b[93m'¶ Bash color code for warning output (yellow).
-
constants.
DATA_DIR
= '/home/travis/build/schuerik/uberdot/data'¶ The directory that stores installed-files, dynamic files and some static files.
-
constants.
DECRYPT_PWD
= None¶ Contains the decryption password in plain text.
-
constants.
DEFAULTS
= {'extension': '', 'name': '', 'optional': False, 'owner': '', 'permission': 644, 'prefix': '', 'replace': '', 'replace_pattern': '', 'secure': True, 'suffix': ''}¶ Default values for command options.
-
constants.
DIR_DEFAULT
= '$HOME'¶ The default path that profiles start in.
-
constants.
DUISTRATEGY
= False¶ True, if --dui should be set as default. Default is
False
.
-
constants.
ENDC
= '\x1b[0m'¶ Bash color code to stop formatation of text.
-
constants.
FORCE
= False¶ True, if --force should be set as default. Default is
False
.
-
constants.
HASH_SEPARATOR
= '#'¶ The symbol that is used as separator for hashes in dynamic file names.
-
constants.
INSTALLED_FILE
= '/home/travis/build/schuerik/uberdot/data/installed/%s.json'¶ The path to the installed-file that will be used for comparison.
-
constants.
INSTALLED_FILE_BACKUP
= '/home/travis/build/schuerik/uberdot/data/installed/%s.json.bak'¶ The path to the file that will be used as backup of the installed-file.
-
constants.
LOGFILE
= ''¶ The file that will be used as logfile. Empty if no logfile will be used. Needs to be normalized before usage. Default is
""
.
-
constants.
LOGGINGLEVEL
= 'info'¶ The current logging level. Default is
info
.
-
constants.
MAKEDIRS
= False¶ True, if uberdot shall create directories if they don't exist. Default is
False
.
-
constants.
NOBOLD
= '\x1b[22m'¶ Bash color code to stop bold text.
-
constants.
PROFILE_FILES
= ''¶ The directory where the profile will be loaded from.
-
constants.
SHELL
= '/bin/bash'¶ The shell that is used to execute event callbacks.
-
constants.
SHELL_ARGS
= '-e -O expand_aliases'¶ The arguments that will be passed to the shell.
-
constants.
SHELL_TIMEOUT
= 60¶ Time in seconds that a shell command is allowed to run without printing something out.
-
constants.
SKIPAFTER
= False¶ True, if all operations shall be ignored by EventAfterInterpreters. Default is
False
.
-
constants.
SKIPBEFORE
= False¶ True, if all operations shall be ignored by EventBeforeInterpreters. Default is
False
.
-
constants.
SKIPEVENTS
= False¶ True, if all operations shall be ignored by EventInterpreters. Default is
False
.
-
constants.
SKIPROOT
= False¶ True, if all operations that requiere root permission shall be omitted. Default is
False
.
-
constants.
SMART_CD
= True¶ True, if event shell scripts shall automatically change the directory to the directory of the profile that triggered the event.
-
constants.
SUPERFORCE
= False¶ True, if uberdot shall overwrite files that are blacklisted. Default is
False
.
-
constants.
TAG_SEPARATOR
= '%'¶ The symbol that is used as separator for tags in dotfile names.
-
constants.
TARGET_FILES
= ''¶ The directory where the dotfiles are located.
-
constants.
VERSION
= '1.13.2_4'¶ Version numbers, seperated by underscore.
First part is the version of uberdot. The second part (after the underscore) is the version of the installed-file schema. The latter will be used to determine compability of the uberdot with the installed-file.
-
constants.
loadconfig
(config_file, installed_filename='default')¶ Loads constants from the config files.
This will load all configs from
CFG_FILES
orconfig_file
if provided. The name of the installed-file will be used to load installed-file specific values.Parameters: - config_file (str) -- Absolute path to the config file to use. If None,
the configs from
CFG_FILES
will be loaded. - installed_filename (str) -- Name of the installed-file for that values will be loaded
- config_file (str) -- Absolute path to the config file to use. If None,
the configs from