Skip to content

Commit

Permalink
initial development
Browse files Browse the repository at this point in the history
  • Loading branch information
ReTeam Labs committed Mar 25, 2020
1 parent 38cef39 commit 953bceb
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@

.git
.gitignore
.gitattributes
Dockerfile
.dockerignore
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
FROM python:3.8

WORKDIR /app

COPY requirements.txt /app
RUN pip install -r requirements.txt

COPY . /app

CMD ["python", "/app/src/app.py"]
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: test

default: test

build:
docker build -t python-build-cli-planner-app .

test: build
docker run -t python-build-cli-planner-app pytest /app/tests/tests.py

start: build
docker run -it python-build-cli-planner-app
Empty file added README.md
Empty file.
Empty file added reminders.csv
Empty file.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.4.1
33 changes: 33 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from database import add_reminder, list_reminders

def handle_input(input):
if(input == "1"):
list_reminders()
print_menu()
elif(input == "2"):
add_reminder("reminder")
list_reminders()
print_menu()
else:
print("Invalid menu option")
print_menu()

def print_menu():
print()
print('|--------------|')
print('| Pluralsight |')
print('| Reminders |')
print('| App |')
print('|--------------|')
print('* * * * * * * * *')
print('Please select an option:')
print()
print('1) List reminders')
print('2) Add a reminder')
choice = input("Choice: ")
handle_input(choice)

def main():
print_menu()

main()
21 changes: 21 additions & 0 deletions src/database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import csv

def list_reminders():
f = open("reminders.csv", "r")

with f:
reader = csv.reader(f)

for row in reader:
print()
for e in row:
print(e.ljust(32), end=' ')
print()

def add_reminder(reminder):
print()
reminder = input("What would you like to be reminded about?: ")

with open('reminders.csv', 'a+', newline='\n') as file:
writer = csv.writer(file)
writer.writerow([reminder])
Empty file added tests/tests.py
Empty file.

0 comments on commit 953bceb

Please sign in to comment.