From 3cda36b562b17587f2c823284c8e9a344c1364bb Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 3 Jan 2018 15:29:38 +0100 Subject: Delete username --- lib/app.py | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'lib/app.py') diff --git a/lib/app.py b/lib/app.py index 721eec1..a8189c7 100644 --- a/lib/app.py +++ b/lib/app.py @@ -1,4 +1,4 @@ -from classes import YELLOW, BLACK, GREY +from classes import BLACK, GREY from commands import Commands from listcommands import ListCommands import os.path @@ -7,35 +7,12 @@ from config import config class Stout(Commands): def __init__(self): - self.name = u'\U0001F37A' #berr icon - self.user = Stout.username() - - def getName(self): - word = ' (' + self.name + ' ) ' - if self.user == '|': - return word - else: - return word + GREY + '(' + self.user + ') ' - - @staticmethod - def username(): - """ - if users exists, return username, else return an empty string - """ - try: - with open(config['path'], 'rb') as fin: - user = fin.readline().split() - if user[0] is '': - return '' - else: - return user[0].decode('utf-8') - except Exception: - return '' + self.name = u'\U0001F37A' #beer icon def action(self, cmd): """ if cmd is empty, do nothing. - if length of cmd is less than 3 and the first word isn't in list of commands, the command is INFO + if length of cmd is less than 3 and the first word isnt in list of commands, the command is INFO else execute command into ListCommands.commands (<- list) """ if cmd is None: @@ -70,13 +47,11 @@ if __name__ == '__main__': cmd = '' if not os.path.isfile(config['path']): - fo = open(config['path'], 'wb') - fo.write('|\n'.encode('utf-8')) - fo.close() + open(config['path'], 'wb').close() while cmd != 'quit': try: - cmd = input('>' + YELLOW + app.getName() + BLACK) + cmd = input('>' + GREY + ' (' + app.name + ' ) ' + BLACK) except (EOFError, KeyboardInterrupt): break -- cgit v1.2.3-18-g5258