summaryrefslogtreecommitdiff
path: root/lib/app.py
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-07-21 11:05:47 +0200
committerSanto Cariotti <sancn@live.com>2017-07-21 11:05:47 +0200
commit1451011e86dcbcaba2e43013ee86042ad27dc6b5 (patch)
treeb31dd291bf6c5e41a237ad853e66ba2363a6035a /lib/app.py
parent99d5a8a7c7f86725d772f19e007c24e9f1397740 (diff)
it accepts only 1 user
Diffstat (limited to 'lib/app.py')
-rw-r--r--lib/app.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/app.py b/lib/app.py
index f994863..31fd270 100644
--- a/lib/app.py
+++ b/lib/app.py
@@ -1,4 +1,4 @@
-from classes import PersonalError, Colors, r, s, host, clear
+from classes import PersonalError, Colors, r, clear
from commands import Commands
from listcommands import ListCommands
@@ -13,16 +13,15 @@ class Stout(Commands):
if self.user == '':
return word
else:
- return word + Colors.grey + '(' + self.user + ':' + host + ') '
+ return word + Colors.grey + '(' + self.user + ') '
@staticmethod
def username():
"""
- if users exists, return username:0.0.0.0, else return an empty string.
- there is a set into user:HOST with a variable called name
+ if users exists, return username, else return an empty string
"""
- if r.hget('user:'+host, 'name') is not None:
- return r.hget('user:'+host, 'name').decode('utf-8') #default is a byte
+ if r.get('user') is not None:
+ return r.get('user').decode('utf-8') #default is a byte
else:
return ''
@@ -69,5 +68,4 @@ if __name__ == '__main__':
app.action(cmd)
r.save()
- s.close()
clear()