aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBlake DeMarcy <desvox@tilde.town>2018-02-13 22:12:56 -0600
committerBlake DeMarcy <desvox@tilde.town>2018-02-13 22:12:56 -0600
commit33dd0a361d703ad4518886ca4b94fec6045c9b0e (patch)
tree66a66fd001127b3b1c82c896b66585ebb15cdb3c
parente0f83592dc5f22a07f79f97ccc63ac66e917e2c7 (diff)
downloadbbj-33dd0a361d703ad4518886ca4b94fec6045c9b0e.tar.gz
basic ass https support
-rw-r--r--clients/network_client.py4
-rw-r--r--clients/urwid/main.py2
-rw-r--r--logs/exceptions/996fef24266a11e78aa402e6a9e126c87
3 files changed, 10 insertions, 3 deletions
diff --git a/clients/network_client.py b/clients/network_client.py
index 8278ae4..87f870e 100644
--- a/clients/network_client.py
+++ b/clients/network_client.py
@@ -49,7 +49,7 @@ class BBJ(object):
See the offical API error documentation for more details.
"""
- def __init__(self, host="127.0.0.1", port=7099):
+ def __init__(self, host="127.0.0.1", port=7099, https=False):
"""
Optionally takes port and host as kwargs. It will immediately
try to resolve a connection to the server, if its down, it
@@ -71,7 +71,7 @@ class BBJ(object):
If you set this to False, anonymous network usage is
guaranteed.
"""
- self.base = "http://{}:{}/api/%s".format(host, port)
+ self.base = "http{}://{}:{}/api/%s".format("s" if https else "", host, port)
self.user_name = self.user_auth = None
self.send_auth = True
try:
diff --git a/clients/urwid/main.py b/clients/urwid/main.py
index ab5050a..229d03d 100644
--- a/clients/urwid/main.py
+++ b/clients/urwid/main.py
@@ -46,7 +46,7 @@ def get_arg(key, default=None, get_value=True):
return value
try:
- network = BBJ(get_arg("host", "127.0.0.1"), get_arg("port", 7099))
+ network = BBJ(get_arg("host", "127.0.0.1"), get_arg("port", 7099), get_arg("https", False, False))
except URLError as e:
# print the connection error in red
exit("\033[0;31m%s\033[0m" % repr(e))
diff --git a/logs/exceptions/996fef24266a11e78aa402e6a9e126c8 b/logs/exceptions/996fef24266a11e78aa402e6a9e126c8
new file mode 100644
index 0000000..2bc229e
--- /dev/null
+++ b/logs/exceptions/996fef24266a11e78aa402e6a9e126c8
@@ -0,0 +1,7 @@
+ File "server.py", line 64, in wrapper
+ value = function(self, body, connection, user)
+ File "server.py", line 380, in format_message
+ formatting.apply_formatting(message, formatter)
+ File "/home/desvox/BBJ/src/formatting.py", line 183, in apply_formatting
+ if not msg_obj[x]["send_raw"]:
+KeyError('send_raw',) \ No newline at end of file
Un proyecto texto-plano.xyz