Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
os path instead of formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
George Gabolaev committed Aug 31, 2019
1 parent e62ca96 commit 5637290
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bmstu_schedule/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import textwrap
import requests
import logging
import os
from bs4 import BeautifulSoup as bsoup
from bmstu_schedule import configs
from bmstu_schedule.group_page_search import get_urls, unload_all_groups
Expand All @@ -39,8 +40,8 @@ def run(group_code, semester_first_monday, outdir):
log.info('Parsing your schedule')
soup = bsoup(page_html.content, 'lxml')

filename = os.path.join(outdir, valid_group_code+'.ics')
try:
filename = '{}/{}.ics'.format(outdir, valid_group_code)
with open(filename, 'w', encoding='u8') as ics:
ics.writelines(textwrap.dedent(configs.ICAL_HEADER))

Expand All @@ -58,6 +59,6 @@ def run(group_code, semester_first_monday, outdir):
return

log.info('Done!')
log.info('File saved at {}/{}.ics'.format(outdir, valid_group_code))
log.info('File saved at {}'.format(filename))
log.info('Now you can import it.')

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name='bmstu-schedule',
version='1.5.1',
version='1.5.2',
author='George Gabolaev',
author_email='[email protected]',
url='https://github.com/BMSTU-Schedule/bmstu-schedule-parser',
Expand Down

0 comments on commit 5637290

Please sign in to comment.