Skip to content

Commit ef3ddd6

Browse files
authored
Merge pull request #163 from dipamsen/fix-pass-time
2 parents ab85468 + b125492 commit ef3ddd6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626

2727
app = Flask(__name__)
28-
CORS(app, resources={r"/*": {"origins": ["https://gyft.metakgp.org", "http://localhost:3000"]}})
28+
CORS(app, resources={r"/*": {"origins": ["https://gyft.metakgp.org", "http://localhost:5173"]}})
2929

3030
# Configure logging
3131
log_handler = logging.StreamHandler(sys.stdout)

timetable/extractor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ def create_timings(_table: Tag | NavigableString) -> list[int]:
6767
)
6868

6969
return [
70-
get_time(time) for
70+
get_time(time.get_text()) for
7171
time in headings if time.get_text() != 'Day Name'
7272
]
7373

7474
def get_time(time: str) -> int:
75-
get_hour = lambda t: int(t.split(':')[0])
76-
return get_hour(time) + 12 if get_hour(time) < 6 else get_hour(time)
75+
hour = int(time.split(':')[0])
76+
return hour + 12 if hour < 6 else hour
7777

7878
def build_courses(html: str, course_names: dict) -> list[Course]:
7979
r"""

0 commit comments

Comments
 (0)