mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
updated Environmental variables #107
This commit is contained in:
parent
2e641f580f
commit
de8f8a37ea
1 changed files with 16 additions and 4 deletions
|
@ -20,10 +20,22 @@ parser.add_argument("-d", "--divider", dest="divider", help="Character that divi
|
|||
parser.add_argument("-w", "--width", dest="width", help="Screen Width (Default: 100)", default=100, type=int)
|
||||
args = parser.parse_args()
|
||||
|
||||
my_tests = os.environ.get("PMM_TESTS") if os.environ.get("PMM_TESTS") else args.tests
|
||||
test = os.environ.get("PMM_TEST") if os.environ.get("PMM_TEST") else args.test
|
||||
debug = os.environ.get("PMM_DEBUG") if os.environ.get("PMM_DEBUG") else args.debug
|
||||
run = os.environ.get("PMM_RUN") if os.environ.get("PMM_RUN") else args.run
|
||||
def check_bool(env_str, default):
|
||||
env_var = os.environ.get(env_str)
|
||||
if env_var is not None:
|
||||
if env_var is True or env_var is False:
|
||||
return env_var
|
||||
elif env_var.lower() in ["t", "true"]:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
return default
|
||||
|
||||
my_tests = check_bool("PMM_TESTS", args.tests)
|
||||
test = check_bool("PMM_TEST", args.test)
|
||||
debug = check_bool("PMM_DEBUG", args.debug)
|
||||
run = check_bool("PMM_RUN", args.run)
|
||||
collections = os.environ.get("PMM_COLLECTIONS") if os.environ.get("PMM_COLLECTIONS") else args.collections
|
||||
|
||||
time_to_run = os.environ.get("PMM_TIME") if os.environ.get("PMM_TIME") else args.time
|
||||
|
|
Loading…
Reference in a new issue