Settings and configuration

Module is containing all necessary global variables for the package.

Module also has the ability to read user-defined data from two paths:

  • $HOME/_SETTINGS_PATH
  • /etc/_SETTINGS_PATH

See _SETTINGS_PATH for details.

Note

If the first path is found, other is ignored.

Example of the configuration file ($HOME/edeposit/antivirus.json):

{
    "USE_CLAMD": false
}

Attributes

antivirus.settings.is_deb_system()[source]

Badly written test whether the system is deb/apt based or not.

antivirus.settings.USE_CLAMD = True

True - clamd daemon will be used, False - clamscan will be used. clamscan takes much less memory, but takes a LOT more time to scan. clamd takes huge amouts of memory (500MB min), but scans in fractions of seconds.

antivirus.settings.DEB_CONF_PATH = '/etc/clamav/'

Configuration file directory at debian systems.

antivirus.settings.SUSE_CONF_PATH = '/etc/'

Configuration file directory at suse systems.

antivirus.settings.CONF_FILE = 'clamd.conf'

Name of the configuration file.

antivirus.settings.CONF_PATH = '/etc/clamav/clamd.conf'

Path to the configuration file.

antivirus.settings.LOCALSOCKET = '/var/run/clamav/clamd.ctl'

Path to the local unix socket - don’t change this if you are not sure (it will break things).

antivirus.settings.PIDFILE = '/var/run/clamav/clamd.pid'

Path to the pid file - don’t change this if you are not sure (it will break things).

antivirus.settings.LOGFILE = '/var/log/clamav/clamav.log'

Path to the log file.

antivirus.settings.get_all_constants()[source]

Get list of all uppercase, non-private globals (doesn’t start with _).

Returns:Uppercase names defined in globals() (variables from this module).
Return type:list
antivirus.settings.substitute_globals(config_dict)[source]

Set global variables to values defined in config_dict.

Parameters:config_dict (dict) – dictionary with data, which are used to set globals.

Note

config_dict have to be dictionary, or it is ignored. Also all variables, that are not already in globals, or are not types defined in _ALLOWED (str, int, float) or starts with _ are silently ignored.