summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/app.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/app.py b/lib/app.py
index f2c151d..2a8a14e 100644
--- a/lib/app.py
+++ b/lib/app.py
@@ -20,10 +20,13 @@ class Stout(Commands):
"""
if users exists, return username, else return an empty string
"""
- if r.get('user') is not None:
- return r.get('user').decode('utf-8') #default is a byte
- else:
- return ''
+ with open('/tmp/stout', 'rb') as fin:
+ user = fin.readline()
+
+ if user == '':
+ return ''
+ else:
+ return user.decode('utf-8')
def action(self, cmd):
"""
@@ -68,4 +71,3 @@ if __name__ == '__main__':
break
app.action(cmd)
- r.save()