Skip to content

Commit

Permalink
Fix bug with empty instructors
Browse files Browse the repository at this point in the history
  • Loading branch information
qasim committed Apr 9, 2016
1 parent ac9d15d commit ac7343e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
'uoftscrapers.scrapers.scraper',
'uoftscrapers.scrapers.scraper.layers'
],
version = '0.2.1',
version = '0.2.2',
description = 'University of Toronto public web scraping scripts.',
author = 'Qasim Iqbal',
author_email = 'me@qas.im',
url = 'https://github.com/cobalt-io/uoft-scrapers',
download_url = 'https://github.com/cobalt-io/uoft-scrapers/tarball/0.2.1',
download_url = 'https://github.com/cobalt-io/uoft-scrapers/tarball/0.2.2',
package_data={'': ['LICENSE.md']},
package_dir={'uoftscrapers': 'uoftscrapers'},
include_package_data=True,
Expand Down
9 changes: 7 additions & 2 deletions uoftscrapers/scrapers/textbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,17 @@ def retrieve_books(section):
instructor = section['section_instructor'].split(',')
if len(instructor) == 2:
instructor = '%s %s' % (instructor[0][:1], instructor[1].strip())
instructor = instructor.strip()
else:
instructor = None
instructor = ''

instructors = [instructor]
if len(instructor) == 0:
instructors = []

meeting_sections = [OrderedDict([
("code", section['section_code']),
("instructors", [instructor])
("instructors", instructors)
])]

course_id = '%s%s' % (section['course_code'], section['session'])
Expand Down

0 comments on commit ac7343e

Please sign in to comment.