pass api url not site

This commit is contained in:
j 2018-05-10 10:29:41 +01:00
parent 19115f1886
commit 66e03ef508

View file

@ -139,12 +139,17 @@ class API(object):
shutil.move(tmpname, filename) shutil.move(tmpname, filename)
def signin(site): def signin(url):
import sys import sys
from getpass import getpass from getpass import getpass
from .web import auth from .web import auth
api = API('https://%s/api/' % site) if not url.startswith('http'):
site = url
url = 'https://%s/api/' % url
else:
site = url.split('/')[2]
api = API(url)
update = False update = False
try: try:
credentials = auth.get(site) credentials = auth.get(site)