summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-09-09 09:56:13 +0200
committerSanto Cariotti <sancn@live.com>2017-09-09 09:56:13 +0200
commit53d6bde7ee3b0a012f7d4111c4478f61aceb7955 (patch)
treeaf2d8fce41f123038da0c2284843edbd24aaec89
parentb9ca522345d05176412dafa0b3a3838e877abc14 (diff)
parentd9d6b91cd0536a43c062f9878fe1ac1829704df2 (diff)
Merge branch 'master' into origin/dev
-rw-r--r--README.md5
-rw-r--r--lib/app.py3
-rw-r--r--lib/classes.py11
-rw-r--r--lib/commands.py9
-rw-r--r--lib/templates/index.html14
-rw-r--r--lib/web.py2
6 files changed, 16 insertions, 28 deletions
diff --git a/README.md b/README.md
index f9ca926..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&amp;utm_medium=referral&amp;utm_content=dcariotti/Stout&amp;utm_campaign=Badge_Grade)
+
![logo](logo_stout.png)
> Stout è distribuito sotto licenza MIT e pertanto è possibile farne il fork, modificarlo e distribuirlo nuovamente.
@@ -6,11 +8,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
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/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 &middot; check TODO list thank to Redis</title>
+ <title>Stout &middot; 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 &middot; Check TODO list thank to Redis">
+ <meta property="og:title" content="Stout &middot; 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 &middot; Check TODO list thank to Redis">
- <meta name="twitter:description" content="Check TODO list thank to Redis">
+ <meta name="twitter:title" content="Stout &middot; 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">
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: