diff --git a/scripts/lang_sync b/scripts/lang_sync index 18ce81b..a10f5f3 100755 --- a/scripts/lang_sync +++ b/scripts/lang_sync @@ -176,8 +176,6 @@ def setup_auth(): """ Setup the authentication for connecting to Eints. """ - global user_cfg - user, passwd = None, None # Read the file if provided. @@ -275,8 +273,6 @@ def build_url(suffix): @param suffix: Path to retrieve from, at L{UserConfig.base_url} @type suffix: C{str} """ - global user_cfg - assert suffix[0] == "/" if user_cfg.base_url[-1] == "/": return user_cfg.base_url + suffix[1:] @@ -420,7 +416,7 @@ def get_eints_languages(): @return: Available language information for the project as returned by Eints. @rtype: C{list} of L{EintsLanguageInfo} """ - global user_cfg, eints_files_cache + global eints_files_cache if eints_files_cache is not None: return eints_files_cache @@ -498,7 +494,7 @@ def get_local_languages(): @return: Found language files. @rtype: C{list} of L{LocalLanguageInfo} """ - global user_cfg, local_files_cache + global local_files_cache if local_files_cache is not None: return local_files_cache @@ -582,8 +578,6 @@ def perform_operation(op_type, lang_type, credits_handle): @param credits_handle: If available, output stream for writing credits of language file changes. @type credits_handle: C{file} or C{None} """ - global user_cfg - if op_type == "create": assert lang_type == "project" # Project creation operation. @@ -639,8 +633,6 @@ def perform_create_project(): """ Create a new project in Eints. """ - global user_cfg - assert user_cfg.project_desc is not None if user_cfg.project_type not in KNOWN_PROJECT_TYPES: diff --git a/webtranslate/rights.py b/webtranslate/rights.py index 2ae62bb..cca94b7 100644 --- a/webtranslate/rights.py +++ b/webtranslate/rights.py @@ -118,8 +118,6 @@ def has_access(page, roles): @return: Whether access is granted. @rtype: C{bool} """ - global _table - if "USER" not in roles: roles = set(["SOMEONE"]) diff --git a/webtranslate/users/development.py b/webtranslate/users/development.py index 7227a7e..54d554d 100644 --- a/webtranslate/users/development.py +++ b/webtranslate/users/development.py @@ -62,8 +62,6 @@ def authenticate(user, pwd): @return: Whether the combination is valid (C{True} means 'valid'). @rtype: C{bool} """ - global _users - if len(pwd) == 0: return False return (user, pwd) in _users diff --git a/webtranslate/users/ldap.py b/webtranslate/users/ldap.py index 51179e7..01cf3f6 100644 --- a/webtranslate/users/ldap.py +++ b/webtranslate/users/ldap.py @@ -63,7 +63,7 @@ def init(): """ Initialize the user admin system. """ - global server, ldap_host + global server import ldap3 rights.init_page_access() @@ -89,7 +89,6 @@ def get_authentication(user, pwd): # Note that failure to authenticate is not fatal, it falls back to an 'unknown' user. groups = set() if user is not None and user != "" and pwd is not None and pwd != "": - global server, ldap_basedn_users, ldap_basedn_groups import ldap3 try: diff --git a/webtranslate/users/redmine.py b/webtranslate/users/redmine.py index 34cb9d6..efc8f94 100644 --- a/webtranslate/users/redmine.py +++ b/webtranslate/users/redmine.py @@ -75,7 +75,7 @@ def connect(): @return: Whether we are connected (not 100% certain). @rtype: C{bool} """ - global db_type, db_schema, db_name, db_password, db_user, db_host, db_port, db_connection + global db_connection if db_connection is not None: return True # Already connected. @@ -142,7 +142,7 @@ def _do_command(cmd, parms): @return: Cursor with the result, if all went well, else C{None} @rtype: db cursor, or C{None} """ - global db_type, db_schema, db_name, db_password, db_user, db_host, db_port, db_connection + global db_connection if db_type == "postgress": import psycopg2 @@ -176,8 +176,6 @@ def query(cmd, parms): @return: Cursor with the result, if all went well, else C{None} @rtype: db cursor, or C{None} """ - global db_type, db_schema, db_name, db_password, db_user, db_host, db_port, db_connection - count = 0 while count < 3: # Connect if not connected. @@ -225,9 +223,6 @@ def get_authentication(user, pwd): @return: UserAuthentication object to test accesses with. @rtype: C{UserAuthentication} """ - global db_type, db_schema, db_name, db_password, db_user, db_host, db_port, db_connection - global owner_role, translator_roles - # Verify user. # Note that failure to authenticate is not fatal, it falls back to an 'unknown' user. if user is not None and user != "" and pwd is not None: