forked from InstaPy/InstaPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
51 lines (30 loc) · 1.36 KB
/
Copy pathsettings.py
File metadata and controls
51 lines (30 loc) · 1.36 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
""" Global variables """
import os
from sys import platform as p_os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
OS_ENV = "windows" if p_os=="win32" else "osx" if p_os=="darwin" else "linux"
class Settings:
""" Globally accessible settings throughout whole project """
log_location = os.path.join(BASE_DIR, 'logs')
database_location = os.path.join(BASE_DIR, 'db', 'instapy.db')
# chromedriver-specific settings
chromedriver_min_version = 2.36
specific_chromedriver = "chromedriver_{}".format(OS_ENV)
chromedriver_location = os.path.join(BASE_DIR, "assets", specific_chromedriver)
if not os.path.exists(chromedriver_location):
chromedriver_location = os.path.join(BASE_DIR, 'assets', 'chromedriver')
# set a logger cache outside the InstaPy object to avoid re-instantiation issues
loggers = {}
logger = None
# set current profile credentials for DB operations
profile = {"id":None, "name":None}
# hold live Quota Supervisor configuration for global usage
QS_config = {}
# specify either connected locally or through a proxy
connection_type = None
# store user-defined delay time to sleep after doing actions
action_delays = {}
class Storage:
""" Globally accessible standalone storage """
# store realtime record activity data
record_activity = {}