File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ __pycache__ /
2+ .cache /
3+ venv /
4+
5+ .envrc
6+ .env
7+ * .pyc
8+ * .db
9+ * .p8
10+ gmail_credentials.json
11+ gmail_token.json
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ __pycache__/
22.cache /
33venv /
44
5+ .env
56.envrc
67* .pyc
78* .db
Original file line number Diff line number Diff line change 1- FROM python:3.7
1+ FROM python:3.8
22
33RUN mkdir /usr/src/app
44WORKDIR /usr/src/app
Original file line number Diff line number Diff line change 1+ version : " 3.8"
2+ services :
3+ coursegrab :
4+ build : .
5+ env_file : " .env"
6+ ports :
7+ - " 5000:5000"
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ appdirs==1.4.3
33aspy.yaml == 1.3.0
44attrs == 19.3.0
55beautifulsoup4 == 4.8.1
6- black
6+ black == 20.8b1
77CacheControl == 0.12.6
88cachetools == 4.0.0
99certifi == 2019.9.11
1010cffi == 1.14.0
1111cfgv == 2.0.1
1212chardet == 3.0.4
13- Click == 7.0
13+ Click == 7.1.2
1414cryptography == 2.9
1515entrypoints == 0.3
1616firebase-admin == 4.0.1
@@ -20,11 +20,6 @@ Flask-Cors==3.0.1
2020Flask-Migrate == 2.5.2
2121Flask-Script == 2.0.6
2222Flask-SQLAlchemy == 2.4.1
23- google-api-core == 1.26.2
24- google-api-python-client == 2.0.2
25- google-auth == 1.28.0
26- google-auth-httplib2 == 0.1.0
27- google-auth-oauthlib == 0.4.3
2823google-cloud-core == 1.3.0
2924google-cloud-firestore == 1.6.2
3025google-cloud-storage == 1.27.0
@@ -77,12 +72,12 @@ sendgrid==6.1.2
7772six == 1.13.0
7873soupsieve == 1.9.5
7974SQLAlchemy == 1.3.11
80- toml == 0.10.0
75+ toml == 0.10.1
8176typed-ast == 1.4.1
8277typing-extensions == 3.7.4.3
8378uritemplate == 3.0.1
8479urllib3 == 1.25.6
8580virtualenv == 16.7.7
8681wcwidth == 0.1.8
8782Werkzeug == 0.16.0
88- zipp == 0.6.0
83+ zipp == 0.6.0
Original file line number Diff line number Diff line change 1+ alembic==1.4.1
2+ appdirs==1.4.3
3+ aspy.yaml==1.3.0
4+ attrs==19.3.0
5+ beautifulsoup4==4.8.1
6+ black
7+ CacheControl==0.12.6
8+ cachetools==4.0.0
9+ certifi==2019.9.11
10+ cffi==1.14.0
11+ cfgv==2.0.1
12+ chardet==3.0.4
13+ Click==7.0
14+ cryptography==2.9
15+ entrypoints==0.3
16+ firebase-admin==4.0.1
17+ flake8==3.7.9
18+ Flask==1.1.1
19+ Flask-Cors==3.0.1
20+ Flask-Migrate==2.5.2
21+ Flask-Script==2.0.6
22+ Flask-SQLAlchemy==2.4.1
23+ google-api-core==1.26.2
24+ google-api-python-client==2.0.2
25+ google-auth==1.28.0
26+ google-auth-httplib2==0.1.0
27+ google-auth-oauthlib==0.4.3
28+ google-cloud-core==1.3.0
29+ google-cloud-firestore==1.6.2
30+ google-cloud-storage==1.27.0
31+ google-resumable-media==0.5.0
32+ googleapis-common-protos==1.51.0
33+ grpcio==1.28.1
34+ h2==2.6.2
35+ hpack==3.0.0
36+ httplib2==0.18.0
37+ hyper==0.7.0
38+ hyperframe==3.2.0
39+ identify==1.4.7
40+ idna==2.8
41+ importlib-metadata==0.23
42+ importlib-resources==1.0.2
43+ itsdangerous==1.1.0
44+ Jinja2==2.10.3
45+ Mako==1.1.2
46+ MarkupSafe==1.1.1
47+ mccabe==0.6.1
48+ more-itertools==7.2.0
49+ msgpack==1.0.0
50+ mypy-extensions==0.4.3
51+ nodeenv==1.3.3
52+ oauthlib==3.1.0
53+ packaging==20.1
54+ pathspec==0.7.0
55+ pluggy==0.13.1
56+ pre-commit==1.20.0
57+ protobuf==3.15.6
58+ py==1.8.1
59+ pyasn1==0.4.8
60+ pyasn1-modules==0.2.8
61+ pycodestyle==2.5.0
62+ pycparser==2.20
63+ pyflakes==2.1.1
64+ PyJWT==1.7.1
65+ pyparsing==2.4.6
66+ pytest==5.3.5
67+ python-dateutil==2.8.1
68+ python-editor==1.0.4
69+ python-http-client==3.2.5
70+ pytz==2019.3
71+ PyYAML==5.1.2
72+ regex==2020.1.8
73+ requests==2.22.0
74+ requests-oauthlib==1.3.0
75+ rsa==4.0
76+ sendgrid==6.1.2
77+ six==1.13.0
78+ soupsieve==1.9.5
79+ SQLAlchemy==1.3.11
80+ toml==0.10.0
81+ typed-ast==1.4.1
82+ typing-extensions==3.7.4.3
83+ uritemplate==3.0.1
84+ urllib3==1.25.6
85+ virtualenv==16.7.7
86+ wcwidth==0.1.8
87+ Werkzeug==0.16.0
88+ zipp==0.6.0
Original file line number Diff line number Diff line change 55def get_course_by_id (course_id ):
66 return Course .query .filter_by (id = course_id ).first ()
77
8+
89def get_course_by_subject_and_course_num (subject_code , course_num ):
910 return Course .query .filter_by (subject_code = subject_code , course_num = course_num ).first ()
1011
@@ -26,11 +27,13 @@ def search_courses(query):
2627 results = sorted (results , key = lambda r : find_query_index (r , query ))
2728 return results
2829
30+
2931def find_query_index (course , key ):
3032 try :
3133 return course .search_string .lower ().index (key .lower ())
3234 except (ValueError ):
3335 return - 1
3436
37+
3538def clear_table ():
3639 Course .query .delete ()
You can’t perform that action at this time.
0 commit comments