Skip to content

Commit

Permalink
Moved scripts into one package.
Browse files Browse the repository at this point in the history
  • Loading branch information
hime committed Mar 11, 2020
1 parent 7211134 commit fcf571f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
6 changes: 0 additions & 6 deletions notes.csv

This file was deleted.

Empty file added postIt/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions menu.py → postIt/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ def print_preview():
" Shows all the post it notes. Each can be displayed\n",
" individually with a delay if argument is given.\n",
"\n",
" post clean\n",
" Removes all the stored notes.\n",
"\n",
"")
9 changes: 6 additions & 3 deletions note.py → postIt/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import csv, time
import os.path

filename = "notes.csv"
filename = "data/notes.csv"

def write(message):
# Writes data into a file.
Expand All @@ -27,8 +27,11 @@ def read(message):
with open(filename, newline='') as csvfile:
spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
for row in spamreader:
print(', '.join(row))
time.sleep(0.5)
message = ' '.join(row)

if message != "note":
print(message)
time.sleep(0.5)
pass

def wipe():
Expand Down
5 changes: 4 additions & 1 deletion post.py → postIt/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@
# Ouput everything to terminal.
read(None)

elif length > 1 and sys.argv[1] == "wipe":
elif length > 1 and sys.argv[1] == "clean":
wipe()

else:
print("Command entered is not valid.")

0 comments on commit fcf571f

Please sign in to comment.