1
0
Fork 0
mirror of https://gitlab.wikimedia.org/ladsgroup/Phabricator-maintenance-bot synced 2024-11-21 19:42: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 sys
import time
import os
import requests
@ -19,7 +20,8 @@ class Client(object):
@classmethod
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())
return cls(*creds)