fhs Namespace Reference

## Classes

class | _TempFile

## Functions

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

## Variables

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