forked from seeraven/gitcache
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal_settings.py
More file actions
55 lines (39 loc) · 2.19 KB
/
Copy pathglobal_settings.py
File metadata and controls
55 lines (39 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
Module for handling the global settings of gitcache.
The global settings can't be retrieved from the config.Config class as they
are not known in advance or not customizable.
Attributes:
GITCACHE_DIR (str): The base directory for hosting all gitcache related information
including the mirrors.
The value is retrieved from the environment variable :code:`GITCACHE_DIR`. If this
variable does not exist, the default value :code:`~/.gitcache` is used.
GITCACHE_DB (str): The database file.
GITCACHE_DB_LOCK (str): The database lock file.
GITCACHE_LOGLEVEL (str): The log level of gitcache, e.g., 'INFO' or 'DEBUG'.
The value is retrieved from the environment variable :code:`GITCACHE_LOGLEVEL`. If this
variable does not exist, the default value :code:`INFO` is used.
GITCACHE_LOGFORMAT (str): The log format of gitcache.
The value is retrieved from the environment variable :code:`GITCACHE_LOGFORMAT`. If this
variable does not exist, the default value :code:`%(asctime)s %(message)s` is used.
Copyright:
2020 by Clemens Rabe <[email protected]>
All rights reserved.
This file is part of gitcache (https://github.com/seeraven/gitcache)
and is released under the "BSD 3-Clause License". Please see the ``LICENSE`` file
that is included as part of this package.
"""
# -----------------------------------------------------------------------------
# Module Import
# -----------------------------------------------------------------------------
import os
# -----------------------------------------------------------------------------
# Settings
# -----------------------------------------------------------------------------
GITCACHE_DIR = os.getenv("GITCACHE_DIR", os.path.join(os.getenv("HOME", "/"), ".gitcache"))
GITCACHE_DB = os.path.join(GITCACHE_DIR, "db")
GITCACHE_DB_LOCK = os.path.join(GITCACHE_DIR, "db.lock")
GITCACHE_LOGLEVEL = os.getenv("GITCACHE_LOGLEVEL", "INFO")
GITCACHE_LOGFORMAT = os.getenv("GITCACHE_LOGFORMAT", "%(asctime)s %(message)s")
# -----------------------------------------------------------------------------
# EOF
# -----------------------------------------------------------------------------