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)
def signin(site):
def signin(url):
import sys
from getpass import getpass
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
try:
credentials = auth.get(site)