From bbe1b2ce86cd91d87d2edb42f84f460c5da8e29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Bueno?= Date: Thu, 26 Apr 2018 14:30:57 +0100 Subject: [PATCH 1/2] Add utils in setup.py I have added O365.utils to packages because without it didn't install utils folder. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 90e778f58070..4ba65d7d53f4 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ maintainer='Janscas', maintainer_email='janscas@users.noreply.github.com', url='https://github.com/janscas/py-o365', - packages=['O365'], + packages=['O365','O365.utils'], install_requires=['requests', 'oauthlib', 'requests_oauthlib', 'beautifulsoup4', 'stringcase', 'python-dateutil', 'tzlocal'], license='Apache 2.0', classifiers=CLASSIFIERS From edc97a81ee0dfa26a49d7a873861f0024f7f2b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Bueno?= Date: Thu, 26 Apr 2018 15:02:21 +0100 Subject: [PATCH 2/2] replace iana_tz by iana_tz.zone Because is need a string --- O365/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/O365/connection.py b/O365/connection.py index 1711a7a4c77a..88a86b063c63 100644 --- a/O365/connection.py +++ b/O365/connection.py @@ -182,12 +182,12 @@ def get_iana_tz(windows_tz): def get_windows_tz(self, iana_tz=None): """ Returns a valid windows TimeZone from a given pytz TimeZone (Iana/Olson Timezones) - Note: Windows Timezones are SHIT!.. no .. really THEY ARE HOLY FUCKING SHIT! + Note: Windows Timezones are SHIT!.. no .. really THEY ARE HOLY FUCKING SHIT!. I AGREE """ iana_tz = iana_tz or self.timezone timezone = IANA_TO_WIN.get(iana_tz.zone if isinstance(iana_tz, tzinfo) else iana_tz) if timezone is None: - raise pytz.UnknownTimeZoneError("Can't find Iana TimeZone " + iana_tz) + raise pytz.UnknownTimeZoneError("Can't find Iana TimeZone " + iana_tz.zone) return timezone