diff --git a/clicada/cli/arg.py b/clicada/cli/arg.py index 441db69..2ea2cb2 100644 --- a/clicada/cli/arg.py +++ b/clicada/cli/arg.py @@ -1,7 +1,7 @@ # import notifier from clicada.cli.notify import NotifyWriter notifier = NotifyWriter() -notifier.notify('loading script') +#notifier.notify('loading script') # standard imports import os diff --git a/clicada/cli/http.py b/clicada/cli/http.py index 0ae7dda..f49ceee 100644 --- a/clicada/cli/http.py +++ b/clicada/cli/http.py @@ -3,6 +3,7 @@ import hashlib import urllib.parse import os import logging +from socket import getservbyname # external imports from usumbufu.client.base import ( @@ -48,7 +49,15 @@ class HTTPSession: def __init__(self, url, auth=None, origin=None): self.base_url = url url_parts = urllib.parse.urlsplit(self.base_url) - url_parts_origin = (url_parts[0], url_parts[1], '', '', '',) + url_parts_origin_host = url_parts[1].split(":") + host = url_parts_origin_host[0] + try: + host = host + ':' + url_parts_origin_host[1] + except IndexError: + host = host + ':' + str(getservbyname(url_parts[0])) + logg.info('changed origin with missing port number from {} to {}'.format(url_parts[1], host)) + url_parts_origin = (url_parts[0], host, '', '', '',) + self.origin = origin if self.origin == None: self.origin = urllib.parse.urlunsplit(url_parts_origin) diff --git a/clicada/cli/notify.py b/clicada/cli/notify.py index 6b8d8ef..8ee25b9 100644 --- a/clicada/cli/notify.py +++ b/clicada/cli/notify.py @@ -1,12 +1,13 @@ # standard imports import os import sys +import shutil class NotifyWriter: def __init__(self, writer=sys.stdout): - (c, r) = os.get_terminal_size() + (c, r) = shutil.get_terminal_size() self.cols = c self.fmt = "\r{:" + "<{}".format(c) + "}" self.w = writer diff --git a/setup.cfg b/setup.cfg index 907da2d..17328ab 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = clicada -version = 0.0.6a1 +version = 0.0.6a2 description = CLI CRM tool for the cic-stack custodial wallet system author = Louis Holbrook author_email = dev@holbrook.no