Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hmmm #10

Open
wants to merge 128 commits into
base: main
Choose a base branch
from
Open

Hmmm #10

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
df232a2
Calendar Function
Nov 11, 2020
3d90b2a
Calendar Commands
Nov 13, 2020
e4586aa
merge
Nov 13, 2020
003889f
removed some files
Nov 13, 2020
132200d
Added modded files
cdu-pree Nov 17, 2020
c1d917f
Updating branch with Playground
cdu-pree Nov 17, 2020
bb4fa9d
Testing
Nov 17, 2020
459194a
testing
Nov 17, 2020
764e5ea
Functions created,Checking a Error for Service
Nov 17, 2020
d15fda4
Merge conflict
cdu-pree Nov 18, 2020
a03c923
Still Testing
Nov 18, 2020
83cee98
"Merging branch"
cdu-pree Nov 19, 2020
83ce7cf
Testing
Nov 19, 2020
4ccbc67
Testing Pharse 2
Nov 20, 2020
ce9786e
"Morning Merge"
cdu-pree Nov 20, 2020
6ae7e53
Merge pull request #7 from Waxes27/Playground
Apillay23 Nov 20, 2020
39e2449
Patient Cancellation
Nov 20, 2020
143c78d
Doctor Cancellation
Nov 20, 2020
bafab1e
Merge pull request #9 from Waxes27/main
Waxes27 Nov 24, 2020
53eaf23
adding __pycache__ files
vpekane Nov 24, 2020
3eb7feb
merge to Playground
vpekane Nov 24, 2020
e13dc2f
__pycahce__ files
vpekane Nov 24, 2020
a15019a
Final Cancel Booking in sample file
Nov 25, 2020
71c82de
Cancel Booking
Nov 25, 2020
80e7ce3
Final Cancel Booking
Nov 25, 2020
dae7b30
Testing
Nov 25, 2020
87cea23
Checking for caldendars via subject and if there is a attendee in the…
Nov 26, 2020
10a2e1b
Cancel Booking Updated to 3 attendees
Nov 26, 2020
809652e
Check Cancel Booking With Them
Nov 26, 2020
0f2ee93
Update
Nov 27, 2020
92fc499
merging
Nov 27, 2020
2568758
added __pycache__ folder
vpekane Nov 27, 2020
33affe2
hmmm
Nov 27, 2020
1027f1a
Update help_cc.py
mbjali Nov 27, 2020
834bca5
Merge branch 'Playground' of https://github.com/Waxes27/WTC-GROUP-PRO…
Nov 27, 2020
1591376
Half intergration of cancel booking
Nov 27, 2020
9d31934
Updated double_booking function
SamBaloyi Nov 27, 2020
1443e5e
Updated view_calendar
mbjali Nov 28, 2020
33ae1b9
updated
mbjali Nov 28, 2020
3782a60
Updated cancel booking,Please Test
Nov 30, 2020
df7bd00
merging
Dec 1, 2020
f8c66c4
Merge branch 'Playground' of https://github.com/Waxes27/WTC-GROUP-PRO…
Dec 1, 2020
e3c4b7e
Unittesting done
Dec 1, 2020
5b0f0dc
Unittesting done
Dec 1, 2020
42f7817
Re -running setup.py
Dec 1, 2020
d2be68e
updated setup.py in Repo
Dec 1, 2020
a60f527
deleted Tokens and __pycache__ and the token.pickle
Dec 1, 2020
899510a
slight adjustments
Dec 1, 2020
c0f61dc
merge to playground
vpekane Dec 2, 2020
fdc98d2
merge to playground
vpekane Dec 2, 2020
a38bb6a
adding modified files from my repo
vpekane Dec 2, 2020
7b1fec1
updated with some minor things to fix
mbjali Dec 3, 2020
f470d2e
updates
vpekane Dec 4, 2020
e81eba2
updates made to view_calendar
vpekane Dec 4, 2020
cbd3770
Merge branch 'Playground' into vpekane
vpekane Dec 4, 2020
5525457
updates to view_cal.py
vpekane Dec 4, 2020
22d022d
additional files for the project
vpekane Dec 4, 2020
0ddbc87
HUGE UPDATE (Volunteering in progress)
Dec 5, 2020
e23fe0c
Update book_slot.py
SamBaloyi Dec 5, 2020
739b764
HUGE UPDATE
Dec 6, 2020
658d902
Implemented undo functionality
cdu-pree Dec 7, 2020
96ffabc
Partial finale
Dec 7, 2020
7bb88b9
Integration
cdu-pree Dec 7, 2020
5102de6
integrating
cdu-pree Dec 7, 2020
c5a6988
Merge pull request #11 from Waxes27/apillay
Apillay23 Dec 8, 2020
aab08c4
Specify user input time format
sbaloyi Dec 8, 2020
7ba8f67
Create standalone function for user input for time
sbaloyi Dec 8, 2020
9b9bcae
Half done verify time function
sbaloyi Dec 8, 2020
ce7de86
hm
Dec 8, 2020
9e9a4d9
Merge branch 'Playground' of https://github.com/Waxes27/WTC-GROUP-PRO…
Dec 8, 2020
cab7318
qwe
Dec 8, 2020
e7dc74e
removed test file
Dec 8, 2020
6889289
Integrating of new input file
cdu-pree Dec 9, 2020
8286b18
Integrating of new input file
cdu-pree Dec 9, 2020
da56016
Intergrate colours on input_API
SamBaloyi Dec 9, 2020
de41df1
Update README.md
cdu-pree Dec 9, 2020
90e934f
add colours to remove booking text
SamBaloyi Dec 9, 2020
49ba52b
Adding iCal module to view calendar
vsithole Dec 9, 2020
397882c
pycache folders
vpekane Dec 10, 2020
2c56937
updated the way a doctor books their volunteer slot
vpekane Dec 10, 2020
287fec5
Add files via upload
tmoshole Dec 11, 2020
e7969ec
Update main.py
fmokoena Dec 11, 2020
2d3988d
Update view_calendar.py
fmokoena Dec 11, 2020
dde06be
Update book_slot.py
fmokoena Dec 11, 2020
b409b49
Add colour for double book text
sbaloyi Dec 11, 2020
3a36d99
Update main.py
fmokoena Dec 11, 2020
00e21cc
Update view_calendar.py
fmokoena Dec 11, 2020
5148978
Update book_slot.py
fmokoena Dec 11, 2020
bee0291
Added two functions for validating time input
sbaloyi Dec 11, 2020
8fb9423
Updated error handling for choosing role
sbaloyi Dec 11, 2020
11c38ef
Updated error handling for role choice in makebook
sbaloyi Dec 11, 2020
fd16479
Updated my error handling mistakes
sbaloyi Dec 11, 2020
5af585c
add colours to help
sbaloyi Dec 11, 2020
00e5793
merging to Playground
vpekane Dec 12, 2020
452b91f
Big Update
cdu-pree Dec 12, 2020
9f1dca3
Update test_double_booking.py
tmoshole Dec 12, 2020
96022f3
updated the function for the patient making a booking (book_vol_slot)
vpekane Dec 12, 2020
c0b9bff
updated the event function and added a new function
vpekane Dec 12, 2020
4e3b5b0
minor fixes
vpekane Dec 12, 2020
7e06187
__pycache__
vpekane Dec 12, 2020
851f829
Merge branch 'Playground' of https://github.com/Waxes27/WTC-GROUP-PRO…
vpekane Dec 12, 2020
7b3bf1e
minor fixes
vpekane Dec 12, 2020
7e85d4d
Update test_double_booking.py
SamBaloyi Dec 12, 2020
92ecd61
Unit testing for input
cdu-pree Dec 13, 2020
3280f6e
Cleaned up Directory structure
cdu-pree Dec 13, 2020
344f238
Minor changes
cdu-pree Dec 13, 2020
b07dfd1
updated view calendar
mbjali Dec 13, 2020
c278a0f
Update view_calendar.py
mbjali Dec 13, 2020
5a3bf7d
minor changes again
vpekane Dec 13, 2020
3fff9e1
merge to Playground
vpekane Dec 13, 2020
edc9212
minor changes
vpekane Dec 13, 2020
d6f1de4
Preparing to revert
cdu-pree Dec 13, 2020
abfa45d
reverting to a previous version
vpekane Dec 13, 2020
760d61d
...
cdu-pree Dec 13, 2020
19dfe11
.....
cdu-pree Dec 13, 2020
72f990e
minor bug fixes
vpekane Dec 13, 2020
48d3713
__pycache__
vpekane Dec 13, 2020
8ac0724
ja
cdu-pree Dec 13, 2020
0d66e1e
..
cdu-pree Dec 13, 2020
f241b13
Updated test_inputs
cdu-pree Dec 13, 2020
8f23a5a
final touches
vpekane Dec 13, 2020
348f20a
Merge branch 'Playground' of https://github.com/Waxes27/WTC-GROUP-PRO…
vpekane Dec 13, 2020
3a9c6a4
minor fixes
vpekane Dec 13, 2020
9902dfb
minor changes
vpekane Dec 13, 2020
9854821
Add files via upload
fmokoena Dec 13, 2020
fae6f43
GUI integrated
fmokoena Dec 13, 2020
31815b0
Update gui.py
fmokoena Dec 13, 2020
eb3d2b1
Update gui.py
fmokoena Dec 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified GUI/__pycache__/GUI.cpython-37.pyc
Binary file not shown.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# WTC-GROUP-PROJECT
# CODING CLINIC BOOKING SYSTEM

The Coding Clinic Booking System has been designed as our WTC Group Project. The purpose behind this project is to provide users
at WeThinkCode with a system that they can run as a Command Line Argument within their Terminals to quickly and efficiently
book a "Coding Clinic" where users can volunteer or choose to participate in these events.

# INSTALLATION

To install the necessary files needed to run the CC Booking Sytem do the following:

Google calendar API
Run admin/setup.py
then:
Run main.py

# USAGE

Once the setup file has been run, you can go into any directory in your terminal and run the following command;
"clinic" which will bring up the Help menu with the list of commands you can use to carry out certain tasks.
Additionally, you can run it with clinic (command name) to directly access one of those commands in order to make
it easier to make or view or even cancel bookings as needed.
Binary file added __pycache__/Calendar_Commands.cpython-37.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions calendar_dict.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": ["ncadj520s391s3gucm8a98rlhk", "nuqne3akhta55gsm0fen5u7r68", "fka8ligpj7n4oaqhe604etrbqo", "1k7tbp669r7g4d5vf9ohhu0tvk", "92lkl3jba4de21uss0t29u1mn4", "s836umh4gl9jg3c4ip1sb51ek0"], "date": ["2020-12-13", "2020-12-14", "2020-12-15", "2020-12-15", "2020-12-16", "2020-12-20"], "start_time": ["19:00", "12:00", "12:00", "17:00", "14:00", "15:00"], "end_time": ["19:30", "12:30", "12:30", "17:30", "14:30", "15:30"], "topic": ["General", "General", "General", "General", "General", "General"], "doctor": ["vpekane", "tmoshole", "tmoshole", "tmoshole", "vsithole", "sbaloyi"], "guest_user_1": ["vpekane", "Available", "Available", "Available", "Available", "Available"], "guest_user_2": ["mbjali", "Available", "Available", "Available", "Available", "Available"], "booked": ["Fully booked", "Available", "Available", "Available", "Available", "Available"]}
12 changes: 12 additions & 0 deletions id_found.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ncadj520s391s3gucm8a98rlhk
nuqne3akhta55gsm0fen5u7r68
fka8ligpj7n4oaqhe604etrbqo
1k7tbp669r7g4d5vf9ohhu0tvk
92lkl3jba4de21uss0t29u1mn4
s836umh4gl9jg3c4ip1sb51ek0
ncadj520s391s3gucm8a98rlhk
nuqne3akhta55gsm0fen5u7r68
fka8ligpj7n4oaqhe604etrbqo
1k7tbp669r7g4d5vf9ohhu0tvk
92lkl3jba4de21uss0t29u1mn4
s836umh4gl9jg3c4ip1sb51ek0
Binary file removed main/.tokens/[email protected]
Binary file not shown.
Binary file removed main/.tokens/[email protected]
Binary file not shown.
Binary file removed main/.tokens/[email protected]
Binary file not shown.
2 changes: 2 additions & 0 deletions main/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
13 changes: 13 additions & 0 deletions main/calendar_dict.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
{"id": ["3sq0bnc8mdgqohoddjv5v5qo0c"], "date": ["2020-12-12"], "start_time": ["12:00"], "end_time": ["12:30"], "topic": ["General"], "doctor": ["ndumasi"], "patient": ["vpekane"]}
=======
{"id": ["650ph837vcau5ukuvrfoe5u3cc", "dls2e0dl9190tpcndl8a3eklek", "fuodap3sb63prtl7ljqbb7orfs", "gqloef33lb68lvt60d1ke60150", "3sq0bnc8mdgqohoddjv5v5qo0c", "igp0rpcg4sd1rvnl4i39v3ck64", "659lldcc0lt9jb8tfkhjrluhhs"], "date": ["2020-12-04", "2020-12-06", "2020-12-06", "2020-12-06", "2020-12-12", "2020-12-12", "2020-12-25"], "start_time": ["10:30", "12:00", "12:00", "12:00", "12:00", "12:00", "12:00"], "end_time": ["11:00", "12:30", "12:30", "12:30", "12:30", "12:30", "13:00"], "topic": ["General", "General", "General", "General", "General", "General", "General"], "doctor": ["ndumasi", "ndumasi", "ndumasi", "ndumasi", "ndumasi", "ndumasi", "ndumasi"], "patient": ["vpekane", "ndumasi", "ndumasi", "ndumasi", "vpekane", "mbjali", "cdu-pree"]}
>>>>>>> 899510a35892dedf19c5b974c0dedb09a6fc7e86
=======
{"id": ["c4m3ses6g061k5hu3igrggvesc", "cu4m12c28u29alfqngiuggjob8", "oisofrb8rjdq9tt7a3fj0r4924", "3sq0bnc8mdgqohoddjv5v5qo0c", "igp0rpcg4sd1rvnl4i39v3ck64", "659lldcc0lt9jb8tfkhjrluhhs"], "date": ["2020-12-09", "2020-12-09", "2020-12-10", "2020-12-12", "2020-12-12", "2020-12-25"], "start_time": ["12:00", "12:00", "12:00", "12:00", "12:00", "12:00"], "end_time": ["12:30", "12:30", "12:30", "12:30", "12:30", "13:00"], "topic": ["General", "General", "General", "General", "General", "General"], "doctor": ["ndumasi", "ndumasi", "ndumasi", "ndumasi", "ndumasi", "ndumasi"], "patient": ["mbjali", "mbjali", "mbjali", "vpekane", "mbjali", "cdu-pree"]}
>>>>>>> Playground
=======
{"id": ["jt4onlk4799v1c2fk74epd0j9c", "92lkl3jba4de21uss0t29u1mn4", "s836umh4gl9jg3c4ip1sb51ek0"], "date": ["2020-12-12", "2020-12-16", "2020-12-20"], "start_time": ["17:00", "14:00", "15:00"], "end_time": ["17:30", "14:30", "15:30"], "topic": ["Available for booking", "Available for booking", "Available for booking"], "doctor": ["sbaloyi", "vsithole", "sbaloyi"], "patient": ["Available", "Available", "Available"]}
>>>>>>> Playground
Empty file.
Binary file modified main/code/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added main/code/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified main/code/api_handler/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified main/code/api_handler/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
57 changes: 49 additions & 8 deletions main/code/api_handler/api_handler.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
from __future__ import print_function
import datetime
import datefinder
import pickle
import os.path
# from googleapiclient.discovery import build
# from google_auth_oauthlib.flow import InstalledAppFlow
# from google.auth.transport.requests import Request
import os
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import time


SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']
SCOPES = ['https://www.googleapis.com/auth/calendar']

creds = None

if os.path.exists('token.pickle'):
with open('token.pickle' ,'rb') as token:
creds = pickle.load(token)
def validate_token():
# username = input_API.book_doctor(list_)
if os.path.exists(f"{os.environ['HOME']}/.config/.clinic/username.txt"):
username_file = open(f"{os.environ['HOME']}/.config/.clinic/username.txt", 'r')
username = username_file.readline()
# RUN A LOGIN HERE
else:
print("User not found...\n")
username = input("Username: ")
# RUN A LOGIN HERE
username_file = open(f"{os.environ['HOME']}/.config/.clinic/username.txt", 'w+')
username_file.write(username)

creds = None

print(creds)
#topic = input_API.book_topic(topic_list)
username = f'{username}@student.wethinkcode.co.za'
if os.path.exists(f"{os.environ['HOME']}/.config/.clinic/.tokens/{username}.pickle"):
with open(f"{os.environ['HOME']}/.config/.clinic/.tokens/{username}.pickle",'rb') as token:
creds = pickle.load(token)
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(f"{os.environ['HOME']}/.config/.clinic/credentials.json"
, SCOPES)
creds = flow.run_local_server(port=0)

with open(f"{os.environ['HOME']}/.config/.clinic/.tokens/{username}.pickle",'wb') as token:
pickle.dump(creds, token)
# print(creds)
return creds


def create_service(creds):
service = build('calendar', 'v3', credentials=creds)
return service


def main():
# print(create_service(validate_token()))
return create_service(validate_token())

main()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading