Loading...
Searching...
No Matches
fhs Namespace Reference

## Classes

class | _TempFile

## Functions

| write_config (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a config file for writing.
| read_config (name=None, text=True, dir=False, multiple=False, opened=True, packagename=None)
| Open a config file for reading.
| remove_config (name=None, dir=False, packagename=None)
| Remove a config file.
| decode_value (value, argtype)
| Parse a string value into its proper type.
| encode_value (value)
| Encode a value into a string which can be stored in a config file.
| help_text (main, options, option_order)
| version_text ()
| load_config (filename, values=None, present=None, options=None)
| save_config (config, name=None, packagename=None)
| Save a dict as a configuration file.
| option (name, help, short=None, multiple=False, optional=False, default=None, noarg=None, argtype=None, module=None, options=None, option_order=None)
| Register commandline argument.
| parse_args (argv=None, options=None, extra=False)
| init (config=None, help=None, version=None, contact=None, packagename=None, system=None, game=False)
| Initialize the module.
| get_config (extra=False)
| Retrieve commandline configuration.
| module_info (modulename, desc, version, contact)
| Register information about a module.
| module_option (modulename, name, help, short=None, multiple=False, optional=False, default=None, noarg=None, argtype=None, options=None, option_order=None)
| Register a commandline option for a module.
| module_init (modulename, config)
| Add configuration for a module.
| module_get_config (modulename, extra=False)
| Retrieve module configuration.
| write_runtime (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a runtime file for writing.
| read_runtime (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a runtime file for reading.
| remove_runtime (name=None, dir=False, packagename=None)
| Remove a reuntime file or directory.
| write_temp (dir=False, text=True, packagename=None)
| Open a temporary file for writing.
| remove_temp (name)
| Remove a temporary directory.
| write_data (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a data file for writing.
| read_data (name=None, text=True, dir=False, multiple=False, opened=True, packagename=None)
| Open a data file for reading.
| remove_data (name=None, dir=False, packagename=None)
| Remove a data file.
| write_cache (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a cache file for writing.
| read_cache (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a cache file for reading.
| remove_cache (name=None, dir=False, packagename=None)
| Remove a cache file.
| write_log (name=None, packagename=None)
| Open a log file for writing.
| write_spool (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a spool file for writing.
| read_spool (name=None, text=True, dir=False, opened=True, packagename=None)
| Open a spool file for reading.
| remove_spool (name=None, dir=False, packagename=None)
| Remove a spool file.
| lock (name=None, info='', packagename=None)
| Acquire a lock.
| unlock (name=None, packagename=None)
| Release a lock.

## Variables

bool | initialized = False
| Flag that is set to True when init() is called.
bool | is_system = False
| Flag that is set during init() if –system was specified, or the application set the system parameter to init().
bool | is_game = False
| Flag that is set during init() if the application set the game parameter to init().
| pname = os.getenv('PACKAGE_NAME', os.path.basename(sys.argv[0]))
| Default program name; can be overridden from functions that use it.
| HOME = os.path.expanduser('~')
| Current user's home directory.
| XDG_CONFIG_HOME = os.getenv('XDG_CONFIG_HOME', os.path.join(HOME, '.config'))
| XDG home directory.
| XDG_CONFIG_DIRS = tuple([XDG_CONFIG_HOME] + os.getenv('XDG_CONFIG_DIRS', '/etc/xdg').split(':'))
| XDG config directory search path.
| XDG_RUNTIME_DIR = os.getenv('XDG_RUNTIME_DIR')
| XDG runtime directory.
| XDG_DATA_HOME = os.getenv('XDG_DATA_HOME', os.path.join(HOME, '.local', 'share'))
| XDG data directory.
| XDG_DATA_DIRS = os.getenv('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':')
| XDG data directory search path.
| XDG_CACHE_HOME = os.getenv('XDG_CACHE_HOME', os.path.join(HOME, '.cache'))
| XDG cache directory.