1
0
Fork 0
mirror of https://gitlab.wikimedia.org/ladsgroup/Phabricator-maintenance-bot synced 2024-11-22 12:02:38 +01:00

Stop forcing sys.argv[1] for creds

This is not really needed
This commit is contained in:
Amir Sarabadani 2022-08-13 16:09:13 +02:00
parent 260ec45d9d
commit 9489dc3653

4
lib.py
View file

@ -1,6 +1,7 @@
import json import json
import sys import sys
import time import time
import os
import requests import requests
@ -19,7 +20,8 @@ class Client(object):
@classmethod @classmethod
def newFromCreds(cls): def newFromCreds(cls):
with open(sys.argv[1], 'r') as f: dir_path = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dir_path, 'creds.json'), 'r') as f:
creds = json.loads(f.read()) creds = json.loads(f.read())
return cls(*creds) return cls(*creds)