Package entropy :: Module core :: Class SystemSettings

Class SystemSettings

source code


This is the place where all the Entropy settings are stored if they are not considered instance constants (etpConst). For example, here we store package masking cache information and settings. Also, this class mimics a dictionary (even if not inheriting it due to issues with the Singleton class).

Instance Methods
 
init_singleton(self)
Replaces __init__ because SystemSettings is a Singleton.
source code
 
destroy(self)
Overloaded method from Singleton.
source code
 
add_plugin(self, system_settings_plugin_instance)
This method lets you add custom parsers to SystemSettings.
source code
 
remove_plugin(self, plugin_id)
This method lets you remove previously added custom parsers from SystemSettings through its plugin identifier.
source code
 
__setitem__(self, mykey, myvalue)
dict method.
source code
 
__getitem__(self, mykey)
dict method.
source code
 
__delitem__(self, mykey)
dict method.
source code
 
__iter__(self)
dict method.
source code
 
__contains__(self, item)
dict method.
source code
 
__cmp__(self, other)
dict method.
source code
 
__hash__(self)
dict method.
source code
 
__len__(self)
dict method.
source code
 
get(self, mykey)
dict method.
source code
 
has_key(self, mykey)
dict method.
source code
 
copy(self)
dict method.
source code
 
fromkeys(self, seq, val=None)
dict method.
source code
 
items(self)
dict method.
source code
 
iteritems(self)
dict method.
source code
 
iterkeys(self)
dict method.
source code
 
keys(self)
dict method.
source code
 
pop(self, mykey, default=None)
dict method.
source code
 
popitem(self)
dict method.
source code
 
setdefault(self, mykey, default=None)
dict method.
source code
 
update(self, kwargs)
dict method.
source code
 
values(self)
dict method.
source code
 
clear(self)
dict method.
source code
 
set_persistent_setting(self, persistent_dict)
Make metadata persistent, the input dict will be merged with the base one at every reset call (clear()).
source code
 
unset_persistent_setting(self, persistent_key)
Remove dict key from persistent dictionary
source code
 
get_setting_files_data(self)
Return a copy of the internal *files* dictionary.
source code
 
get_mtime_files_data(self)
Return a copy of the internal *mtime* dictionary.
source code
 
keywords_parser(self)
Parser returning package keyword masking metadata read from package.keywords file.
source code
 
unmask_parser(self)
Parser returning package unmasking metadata read from package.unmask file.
source code
 
mask_parser(self)
Parser returning package masking metadata read from package.mask file.
source code
 
system_mask_parser(self)
Parser returning system packages mask metadata read from package.system_mask file.
source code
 
license_mask_parser(self)
Parser returning packages masked by license metadata read from license.mask file.
source code
 
repos_license_whitelist_parser(self)
Parser returning licenses considered accepted by default (= GPL compatibles) read from package.lic_whitelist.
source code
 
repos_mask_parser(self)
Parser returning packages masked at repository level read from packages.db.mask inside the repository database directory.
source code
 
repos_system_mask_parser(self)
Parser returning system packages mask metadata read from packages.db.system_mask file inside the repository directory.
source code
 
system_package_sets_parser(self)
Parser returning system defined package sets read from /etc/entropy/packages/sets.
source code
 
system_dirs_parser(self)
Parser returning directories considered part of the base system.
source code
 
system_dirs_mask_parser(self)
Parser returning directories NOT considered part of the base system.
source code
 
hw_hash_parser(self)
Hardware hash metadata parser and generator.
source code
 
system_rev_symlinks_parser(self)
Parser returning important system symlinks mapping.
source code
 
conflicting_tagged_packages_parser(self)
Parser returning packages that could have been installed because they aren't in the same scope, but ending up creating critical issues.
source code
 
socket_service_parser(self)
Parses socket service configuration file.
source code
 
system_parser(self)
Parses Entropy system configuration file.
source code
 
repositories_parser(self)
Setup Entropy Client repository settings reading them from the relative config file specified in etpConst['repositoriesconf']
source code

Inherited from Singleton: is_destroyed, is_singleton

Inherited from object: __delattr__, __getattribute__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods

Inherited from Singleton: __new__

Properties

Inherited from object: __class__

Method Details

init_singleton(self)

source code 

Replaces __init__ because SystemSettings is a Singleton. see Singleton API reference for more information.

destroy(self)

source code 

Overloaded method from Singleton. "Destroys" the instance.

@return None

add_plugin(self, system_settings_plugin_instance)

source code 

This method lets you add custom parsers to SystemSettings.
Mind that you are responsible of handling your plugin instance
and remove it before it is destroyed. You can remove the plugin
instance at any time by issuing remove_plugin.
Every add_plugin or remove_plugin method will also issue clear()
for you. This could be bad and it might be removed in future.

@param plugin_id -- plugin identifier
@type plugin_id basestring
@param system_settings_plugin_instance -- valid SystemSettingsPlugin
    instance
@type system_settings_plugin_instance SystemSettingsPlugin instance

remove_plugin(self, plugin_id)

source code 

This method lets you remove previously added custom parsers from SystemSettings through its plugin identifier. If plugin_id is not available, KeyError exception will be raised. Every add_plugin or remove_plugin method will also issue clear() for you. This could be bad and it might be removed in future.

@param plugin_id -- plugin identifier @type plugin_id basestring

__setitem__(self, mykey, myvalue)
(Index assignment operator)

source code 

dict method. See Python dict API reference.

__getitem__(self, mykey)
(Indexing operator)

source code 

dict method. See Python dict API reference.

__delitem__(self, mykey)
(Index deletion operator)

source code 

dict method. See Python dict API reference.

__iter__(self)

source code 

dict method. See Python dict API reference.

__contains__(self, item)
(In operator)

source code 

dict method. See Python dict API reference.

__cmp__(self, other)
(Comparison operator)

source code 

dict method. See Python dict API reference.

__hash__(self)
(Hashing function)

source code 

dict method. See Python dict API reference.

Overrides: object.__hash__

__len__(self)
(Length operator)

source code 

dict method. See Python dict API reference.

get(self, mykey)

source code 

dict method. See Python dict API reference.

has_key(self, mykey)

source code 

dict method. See Python dict API reference.

copy(self)

source code 

dict method. See Python dict API reference.

fromkeys(self, seq, val=None)

source code 

dict method. See Python dict API reference.

items(self)

source code 

dict method. See Python dict API reference.

iteritems(self)

source code 

dict method. See Python dict API reference.

iterkeys(self)

source code 

dict method. See Python dict API reference.

keys(self)

source code 

dict method. See Python dict API reference.

pop(self, mykey, default=None)

source code 

dict method. See Python dict API reference.

popitem(self)

source code 

dict method. See Python dict API reference.

setdefault(self, mykey, default=None)

source code 

dict method. See Python dict API reference.

update(self, kwargs)

source code 

dict method. See Python dict API reference.

values(self)

source code 

dict method. See Python dict API reference.

clear(self)

source code 

dict method. See Python dict API reference. Settings are also re-initialized here.

@return None

set_persistent_setting(self, persistent_dict)

source code 

Make metadata persistent, the input dict will be merged with the base one at every reset call (clear()).

@param persistent_dict -- dictionary to merge @type persistent_dict dict

@return None

unset_persistent_setting(self, persistent_key)

source code 

Remove dict key from persistent dictionary

@param persistent_key -- key to remove @type persistent_dict dict

@return None

get_setting_files_data(self)

source code 

Return a copy of the internal *files* dictionary. This dict contains config file paths and their identifiers.

@return dict __setting_files

get_mtime_files_data(self)

source code 

Return a copy of the internal *mtime* dictionary. This dict contains config file paths and their current mtime.

@return dict __mtime_files

keywords_parser(self)

source code 

Parser returning package keyword masking metadata read from package.keywords file. This file contains package mask or unmask directives based on package keywords.

@return dict data

unmask_parser(self)

source code 

Parser returning package unmasking metadata read from package.unmask file. This file contains package unmask directives, allowing to enable experimental or *secret* packages.

@return list parsed data

mask_parser(self)

source code 

Parser returning package masking metadata read from package.mask file. This file contains package mask directives, allowing to disable experimental or *secret* packages.

@return list parsed data

system_mask_parser(self)

source code 

Parser returning system packages mask metadata read from package.system_mask file. This file contains packages that should be always kept installed, extending the already defined (in repository database) set of atoms.

@return list parsed data

license_mask_parser(self)

source code 

Parser returning packages masked by license metadata read from license.mask file. Packages shipped with licenses listed there will be masked.

@return list parsed data

repos_license_whitelist_parser(self)

source code 

Parser returning licenses considered accepted by default (= GPL compatibles) read from package.lic_whitelist.

@return dict parsed data

repos_mask_parser(self)

source code 

Parser returning packages masked at repository level read from packages.db.mask inside the repository database directory.

@return dict parsed data

repos_system_mask_parser(self)

source code 

Parser returning system packages mask metadata read from packages.db.system_mask file inside the repository directory. This file contains packages that should be always kept installed, extending the already defined (in repository database) set of atoms.

@return dict parsed data

system_package_sets_parser(self)

source code 

Parser returning system defined package sets read from /etc/entropy/packages/sets.

@return dict parsed data

system_dirs_parser(self)

source code 

Parser returning directories considered part of the base system.

@return list parsed data

system_dirs_mask_parser(self)

source code 

Parser returning directories NOT considered part of the base system. Settings here overlay system_dirs_parser.

@return list parsed data

hw_hash_parser(self)

source code 

Hardware hash metadata parser and generator. It returns a theorically unique SHA256 hash bound to the computer running this Framework.

@return basestring containing SHA256 hexdigest

system_rev_symlinks_parser(self)

source code 

Parser returning important system symlinks mapping. For example:
    {'/usr/lib': ['/usr/lib64']}
Useful for reverse matching files belonging to packages.

@return dict containing the mapping

conflicting_tagged_packages_parser(self)

source code 

Parser returning packages that could have been installed because they aren't in the same scope, but ending up creating critical issues. You can see it as a configurable conflict map.

@return dict parsed data

socket_service_parser(self)

source code 

Parses socket service configuration file. This file contains information about Entropy remote service ports and SSL.

@return dict data

system_parser(self)

source code 

Parses Entropy system configuration file.

@return dict data

repositories_parser(self)

source code 

Setup Entropy Client repository settings reading them from the relative config file specified in etpConst['repositoriesconf']

@return None