From 5c2f0ebd1dfee1a542fdfdb4c07a94f2226453b7 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 22 Aug 2017 12:08:48 +0200 Subject: changed readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index f9ca926..2849b01 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,10 @@ Scrivere info [cmd] per avere più informazioni su un comando. Stout è un software che tramite linea di comando, e seguendo degli appositi comandi, permette di modificare la lista dei todo (cose da fare) ed eliminarli una volta fatti. -Prima di poter utilizzare Stout, bisogna installare Python3, Flask e Redis: +Prima di poter utilizzare Stout, bisogna installare Python3 e Flask: ```bash sudo apt install python3 sudo pip install Flask -sudo pip install redis ``` ### web.py -- cgit v1.2.3-18-g5258 From f34c4724bcea33adc70574937e130057f53df66f Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 22 Aug 2017 12:12:23 +0200 Subject: deleted 'redis' words --- lib/templates/index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 @@ - Stout · check TODO list thank to Redis + Stout · check TODO list - - + + - + - + - - + + -- cgit v1.2.3-18-g5258 From 0825f0e49be9c652ad6b8733271cab6ba975b848 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 4 Sep 2017 11:24:56 +0200 Subject: fixed Codacy's stuff --- lib/app.py | 3 +-- lib/classes.py | 11 ----------- lib/commands.py | 9 ++++----- lib/web.py | 2 +- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/lib/app.py b/lib/app.py index 5e0b3d8..4226585 100644 --- a/lib/app.py +++ b/lib/app.py @@ -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/web.py b/lib/web.py index bbad99d..ca8e10f 100644 --- a/lib/web.py +++ b/lib/web.py @@ -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: -- cgit v1.2.3-18-g5258 From 2dee4ec4a825eb3743c3e1e33bb1edcd193737d9 Mon Sep 17 00:00:00 2001 From: The Codacy Badger Date: Tue, 5 Sep 2017 08:16:40 +0000 Subject: Add Codacy badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2849b01..9f78acc 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ sudo pip install Flask ### web.py +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/09f814cd759f4d7eaac5a650c8114fef)](https://www.codacy.com/app/dunkerC/Stout?utm_source=github.com&utm_medium=referral&utm_content=dcariotti/Stout&utm_campaign=badger) + Il software dispone di un client per il web in modo da visualizzare la lista dei todo in modo più comodo. _Necessita dell'installazione del microframework Flask_. Per avviarlo: ```bash -- cgit v1.2.3-18-g5258 From 22ca89def791e87e69931807744080c62ed6072d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 5 Sep 2017 10:17:36 +0200 Subject: codacy badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2849b01..8c9f951 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/09f814cd759f4d7eaac5a650c8114fef)](https://www.codacy.com/app/dunkerC/Stout?utm_source=github.com&utm_medium=referral&utm_content=dcariotti/Stout&utm_campaign=Badge_Grade) + ![logo](logo_stout.png) > Stout è distribuito sotto licenza MIT e pertanto è possibile farne il fork, modificarlo e distribuirlo nuovamente. -- cgit v1.2.3-18-g5258 From d9d6b91cd0536a43c062f9878fe1ac1829704df2 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 5 Sep 2017 15:28:40 +0200 Subject: Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 37879e8..8c9f951 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ sudo pip install Flask ### web.py -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/09f814cd759f4d7eaac5a650c8114fef)](https://www.codacy.com/app/dunkerC/Stout?utm_source=github.com&utm_medium=referral&utm_content=dcariotti/Stout&utm_campaign=badger) - Il software dispone di un client per il web in modo da visualizzare la lista dei todo in modo più comodo. _Necessita dell'installazione del microframework Flask_. Per avviarlo: ```bash -- cgit v1.2.3-18-g5258