diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.py | 3 | ||||
-rw-r--r-- | lib/classes.py | 11 | ||||
-rw-r--r-- | lib/commands.py | 9 | ||||
-rw-r--r-- | lib/templates/index.html | 14 | ||||
-rw-r--r-- | lib/web.py | 2 |
5 files changed, 13 insertions, 26 deletions
@@ -1,4 +1,4 @@ -from classes import clear, YELLOW, BLACK, GREY +from classes import YELLOW, BLACK, GREY from commands import Commands from listcommands import ListCommands import os.path @@ -25,7 +25,6 @@ class Stout(Commands): try: with open(config['path'], 'rb') as fin: user = fin.readline().split() - if user[0] == '': return '' else: diff --git a/lib/classes.py b/lib/classes.py index 56a59d3..33cc0ea 100644 --- a/lib/classes.py +++ b/lib/classes.py @@ -1,20 +1,9 @@ -try: - from .config import config as co -except SystemError: - from config import config as co - RED = '\033[91m' YELLOW = '\033[93m' GREY = '\033[90m' BLACK = '\033[0m' BOLD = '\033[1m' -def clear(): - """ - clear the window - """ - print('\n' * 100) - class PersonalError(Exception): def __init__(self, value): diff --git a/lib/commands.py b/lib/commands.py index defdef6..663f231 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -1,4 +1,4 @@ -from classes import PersonalError, clear, RED, GREY +from classes import PersonalError, RED, GREY from listcommands import ListCommands from config import config as co @@ -42,7 +42,7 @@ class Commands(object): print(fin.readline().decode('utf-8')) else: print('nil') - elif cmd[2] not in ListCommands.commands['get'][1]: #check if the word after 'i' exists + elif cmd[2] not in ListCommands.commands['get'][1]: raise KeyError else: print(co[cmd[2]]) @@ -50,7 +50,7 @@ class Commands(object): with open(co['path'], 'rb') as fout: try: lines = fout.readlines() - except: + except Exception as e: lines = '' if lines is not None: @@ -93,7 +93,6 @@ class Commands(object): try: if len(cmd) > ListCommands.info['del'][1]: raise PersonalError(GREY + 'del ' + RED + 'accetta 1 parametro') - count = countID() if count == 0: #todo list is empty @@ -120,7 +119,7 @@ class Commands(object): def countID(): with open(co['path'], 'rb') as fout: - for i, val in enumerate(fout.readlines()): + for i, _ in enumerate(fout.readlines()): count = i return count diff --git a/lib/templates/index.html b/lib/templates/index.html index 2c22066..bd02368 100644 --- a/lib/templates/index.html +++ b/lib/templates/index.html @@ -1,19 +1,19 @@ <!DOCTYPE html> <html> <head> - <title>Stout · check TODO list thank to Redis</title> + <title>Stout · check TODO list</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="keywords" content="stout, redis, todo, list"> - <meta name="description" content="Check TODO list thank to Redis"> + <meta name="keywords" content="stout, todo, list"> + <meta name="description" content="Check TODO list"> <meta property="og:site_name" content="Stout"> - <meta property="og:title" content="Stout · Check TODO list thank to Redis"> + <meta property="og:title" content="Stout · Check TODO list"> <meta property="og:url" content="http://github.com/dcariotti/Stout"> <meta property="og:image" content="https://raw.githubusercontent.com/dcariotti/Stout/master/logo_stout.png"> - <meta property="og:description" content="Check TODO list thank to Redis"> + <meta property="og:description" content="Check TODO list"> <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:title" content="Stout · Check TODO list thank to Redis"> - <meta name="twitter:description" content="Check TODO list thank to Redis"> + <meta name="twitter:title" content="Stout · Check TODO list"> + <meta name="twitter:description" content="Check TODO list"> <meta name="twitter:creator" content="@dcariotti"> <meta name="twitter:image" content="https://raw.githubusercontent.com/dcariotti/Stout/master/logo_stout.png"> <link href="https://fonts.googleapis.com/css?family=Space+Mono" rel="stylesheet" type="text/css"> @@ -8,7 +8,7 @@ def hello(): with open(config['path'], 'rb') as fout: try: lines = fout.readlines() - except: + except Exception as e: lines = '' if lines is not None: |