init variable order, so that tests can be built.
This commit is contained in:
@@ -23,8 +23,17 @@ from classes.user import User
|
||||
from classes.gallery import Gallery
|
||||
|
||||
# GLOBAL VARIABLE SECTION
|
||||
CONFIGS = load_config_variables()
|
||||
CONFIGS = None
|
||||
# Enable a default "everyone" flag for when running stuff like download gallery
|
||||
USERS = []
|
||||
ARGS = None
|
||||
|
||||
|
||||
def init_globals() -> None:
|
||||
"""Initialize global config and CLI args."""
|
||||
global CONFIGS, USERS, ARGS
|
||||
if CONFIGS is None:
|
||||
CONFIGS = load_config_variables()
|
||||
USERS = ["everyone"] + [user["name"] for user in CONFIGS["users"]]
|
||||
ARGS = argparser(USERS)
|
||||
|
||||
@@ -304,6 +313,7 @@ def scrap_everyone() -> None:
|
||||
|
||||
def main():
|
||||
"""Main module to decide what to do based on the parsed arguments"""
|
||||
init_globals()
|
||||
if ARGS.scrapper:
|
||||
rgx_shared = re.compile("push|main|instagram|kemono")
|
||||
if (ARGS.user in "everyone") and (rgx_shared.search(ARGS.scrapper)):
|
||||
|
||||
Reference in New Issue
Block a user