common.config package¶
Submodules¶
common.config.Environment module¶
Environment functionality
-
class
common.config.Environment.
ConfigFile
(filename)¶ Bases:
object
The ConfigFile class handles a config file. It makes a distinction between global entries and the entries in a fully qualified domain name (fqdn) section. The fqdn entries overrule the global entries.
-
as_dict
()¶ Return a dictionary representing the options in the configuration file.
-
check
()¶ Check whether parameters are present in the global section
-
extend_from_other
()¶
-
set_sections
()¶
-
-
common.config.Environment.
generate_env
()¶
-
common.config.Environment.
is_using_cache
()¶
-
common.config.Environment.
is_using_db2
()¶
-
common.config.Environment.
is_using_filebased
()¶
-
common.config.Environment.
is_using_mysql
()¶
-
common.config.Environment.
is_using_oracle
()¶
-
common.config.Environment.
is_using_postgresql
()¶
-
common.config.Environment.
is_using_sqlite
()¶
common.config.Profile module¶
from common.config.Profile import profiles # get profile of current thread profile = profiles.get_current_profile() # create profile for current thread profile = create_profile.create_profile()
-
class
common.config.Profile.
Profile
(username=None, password=None, dbname=None, project=None, privileges=None, sso_ticket=None, sso_username=None, sso_password=None, **args)¶ Bases:
object
A Profile stores the database information of an user
-
classmethod
get_project_privileges
(project_env, privileges_env='')¶ - project and privileges can be combined in the Env, example
- project : ALL (2)
- or only project, example :
- project : ALL
-
get_username
()¶ If set return the SSO username, otherwise username If database login is done via sso_ticket then the username is used for the database connection and sso_username is the correct (AWCONTEXT) username.
-
get_username_db_connection
()¶ return the username used for the database connection
-
is_administrator
()¶ check if user is an administrator
-
is_anonymous
()¶ check if user is an anonymous user
-
set_username
(username)¶ set the username
-
username
¶ If set return the SSO username, otherwise username If database login is done via sso_ticket then the username is used for the database connection and sso_username is the correct (AWCONTEXT) username.
-
classmethod
-
exception
common.config.Profile.
ProfileError
¶ Bases:
Exception
-
class
common.config.Profile.
ProfileFactory
¶ Bases:
object
-
create_default_profile
()¶ create a default (AWANONYMOUS) profile
-
create_profile
(username=None, password=None, dbname=None, project=None, privileges=None, sso_ticket=None, sso_username=None, sso_password=None, **args)¶ create a profile with the given information
-
create_robot_profile
()¶ create a AWROBOT profile
-
create_world_profile
()¶ create a AWWORLD profile
-
get_current_profile
()¶ return the profile of the current thread
-
get_current_profile_id
()¶ return the profile id, this is the id of the current thread
-
has_profile
()¶ return whether the current thread has a profile
-
remove_profile
()¶ remove the profile of the current thread
-
-
common.config.Profile.
database_anonymous
= ['AWANONYMOUS', 'AWAROBOT', 'AWWORLD', 'AWDEMO']¶ The database administrator accounts Projects can define additional administrators by adding them to the project specific <project>.database.Database.py
common.config.ProfileThread module¶
module with ProfileThread
-
class
common.config.ProfileThread.
ProfileThread
(parent, project, username, password, dbname=None, method=None, method_args={}, privileges=1, sso_password=None, sso_ticket=None, sso_username=None)¶ Bases:
threading.Thread
Base class for running a seperate thread with profile and database connection
Either create an instance with the __init__() method or with the get_profile_thread()
-
classmethod
get_profile_thread
(parent=None, method=None, method_args={})¶ return ProfileThread object based on the current profile
-
run
()¶ run the thread
-
classmethod
set_case_insensitive
(comp=True, sort=True)¶ set case insensitive querying
-
classmethod
common.config.initial module¶
Augment paths for Astro-WISE environment
-
common.config.initial.
augment_astrowise_path
(var, augmentation)¶ This is same as augment_system_path except that the order is changed; the user set variable is preferred over the internal one defined here.
-
common.config.initial.
augment_system_path
(var, augmentation)¶ Prepend the augmentation to the environment variable “var”
common.config.noreadline module¶
noreadline
Contains dummy routines that can be substituted on platforms where a working readline module is missing.
-
common.config.noreadline.
get_current_history_length
(*args)¶
-
common.config.noreadline.
parse_and_bind
(*args)¶
-
common.config.noreadline.
read_history_file
(*args)¶
-
common.config.noreadline.
set_completer
(*args)¶
-
common.config.noreadline.
set_history_length
(*args)¶
-
common.config.noreadline.
set_pre_input_hook
(*args)¶
-
common.config.noreadline.
write_history_file
(*args)¶
common.config.startup module¶
Python interpreter startup script.
This script is run when the interpreter starts. It customizes the standard Python interpreter to include the following:
- Custom prompt
- Readline key bindings for command completion and history search
- Persistent command history stored in ${HOME}/.awehistory
- Session log stored in ${HOME}/.awe/awesession.log
If the user has a “${HOME}/.awe/startup.py” file, this file is executed instead of the automatic imports.
Module contents¶
Local packages and modules