Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ezwang committed Feb 24, 2019
1 parent 51bd474 commit 0d80b42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion penn/wharton.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def get_reservations(self, sessionid):
return reservations

def book_reservation(self, sessionid, roomid, start, end):
""" Book a reservation given the session id, the room id as an integer, and the start and end time as datetimes. """
duration = int((end - start).seconds / 60)
booking_url = "{}/reserve/{}/{}/?d={}".format(BASE_URL, roomid, start.strftime("%Y-%m-%dT%H:%M:%S-05:00"), duration)
resp = requests.get(booking_url, cookies={"sessionid": sessionid})
Expand Down Expand Up @@ -81,7 +82,7 @@ def book_reservation(self, sessionid, roomid, start, end):
return {"success": True}

def delete_booking(self, sessionid, booking_id):
"""Deletes a Wharton GSR Booking for a given booking and session id"""
""" Deletes a Wharton GSR Booking for a given booking and session id. """
url = "{}{}{}/".format(BASE_URL, "/delete/", booking_id)
cookies = dict(sessionid=sessionid)

Expand Down Expand Up @@ -115,6 +116,7 @@ def delete_booking(self, sessionid, booking_id):
return {"success": True}

def get_wharton_gsrs(self, sessionid, date):
""" Make a request to retrieve Wharton GSR listings. """
if date:
date += " 05:00"
else:
Expand All @@ -130,6 +132,7 @@ def get_wharton_gsrs(self, sessionid, date):
raise APIError('Remote server returned status code {}.'.format(resp.status_code))

def switch_format(self, gsr):
""" Convert the Wharton GSR format into the studyspaces API format. """
if "error" in gsr:
return gsr
rooms = {
Expand Down Expand Up @@ -172,5 +175,6 @@ def switch_format(self, gsr):
return {"categories": [rooms]}

def get_wharton_gsrs_formatted(self, sessionid):
""" Return the wharton GSR listing formatted in studyspaces format. """
gsrs = self.get_wharton_gsrs(sessionid, None)
return self.switch_format(gsrs)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url='https://github.com/pennlabs/penn-sdk-python',
author='Penn Labs',
author_email='[email protected]',
version='1.8',
version='1.8.1',
packages=['penn'],
license='MIT',
package_data={
Expand Down

0 comments on commit 0d80b42

Please sign in to comment.