diff options
author | Mike Crute <mcrute@gmail.com> | 2009-04-26 18:57:09 -0400 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2009-04-26 18:57:09 -0400 |
commit | 8cfbd1b970870a0d2594e147cd9bcc223d0a33b9 (patch) | |
tree | 18b1b108deeeed8088ddbd87d8c708a00dee104c | |
parent | ecb1c615c9293c32dece1d116e16edc1288988ff (diff) | |
download | calendar_proxy-8cfbd1b970870a0d2594e147cd9bcc223d0a33b9.tar.bz2 calendar_proxy-8cfbd1b970870a0d2594e147cd9bcc223d0a33b9.tar.xz calendar_proxy-8cfbd1b970870a0d2594e147cd9bcc223d0a33b9.zip |
Cleaning up some of the testing code.
-rw-r--r-- | .hgignore | 2 | ||||
-rw-r--r-- | exchange/commands.py | 6 | ||||
-rw-r--r-- | server.py | 11 |
3 files changed, 14 insertions, 5 deletions
diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..2c9154d --- /dev/null +++ b/.hgignore | |||
@@ -0,0 +1,2 @@ | |||
1 | syntax: glob | ||
2 | *.pyc | ||
diff --git a/exchange/commands.py b/exchange/commands.py index 89db579..40446e2 100644 --- a/exchange/commands.py +++ b/exchange/commands.py | |||
@@ -22,6 +22,7 @@ import dateutil.parser | |||
22 | from icalendar import Calendar, Event, Alarm | 22 | from icalendar import Calendar, Event, Alarm |
23 | 23 | ||
24 | from exchange import ExchangeException | 24 | from exchange import ExchangeException |
25 | from exchange.timezones import EST | ||
25 | 26 | ||
26 | 27 | ||
27 | class ExchangeCommand(object): | 28 | class ExchangeCommand(object): |
@@ -95,12 +96,13 @@ class FetchCalendar(ExchangeCommand): | |||
95 | 96 | ||
96 | sql = """ | 97 | sql = """ |
97 | SELECT | 98 | SELECT |
99 | PidLidAllAttendeesString AS attendees, | ||
98 | "urn:schemas:calendar:location" AS location, | 100 | "urn:schemas:calendar:location" AS location, |
101 | "urn:schemas:calendar:organizer" AS organizer, | ||
102 | "urn:schemas:calendar:meetingstatus" AS status, | ||
99 | "urn:schemas:httpmail:normalizedsubject" AS subject, | 103 | "urn:schemas:httpmail:normalizedsubject" AS subject, |
100 | "urn:schemas:calendar:dtstart" AS start_date, | 104 | "urn:schemas:calendar:dtstart" AS start_date, |
101 | "urn:schemas:calendar:dtend" AS end_date, | 105 | "urn:schemas:calendar:dtend" AS end_date, |
102 | "urn:schemas:calendar:busystatus" AS busy_status, | ||
103 | "urn:schemas:calendar:instancetype" AS instance_type, | ||
104 | "urn:schemas:calendar:timezone" AS timezone_info, | 106 | "urn:schemas:calendar:timezone" AS timezone_info, |
105 | "urn:schemas:httpmail:textdescription" AS description | 107 | "urn:schemas:httpmail:textdescription" AS description |
106 | FROM | 108 | FROM |
@@ -18,7 +18,7 @@ from exchange.authenticators import CookieAuthenticator | |||
18 | 18 | ||
19 | class CalendarHandler(BaseHTTPRequestHandler): | 19 | class CalendarHandler(BaseHTTPRequestHandler): |
20 | def do_GET(self): | 20 | def do_GET(self): |
21 | print('> GET CALENDARS') | 21 | print('* Fetching Calendars') |
22 | 22 | ||
23 | fetcher = FetchCalendar(self.server.exchange_server) | 23 | fetcher = FetchCalendar(self.server.exchange_server) |
24 | authenticator = CookieAuthenticator(self.server.exchange_server) | 24 | authenticator = CookieAuthenticator(self.server.exchange_server) |
@@ -27,7 +27,11 @@ class CalendarHandler(BaseHTTPRequestHandler): | |||
27 | fetcher.authenticator = authenticator | 27 | fetcher.authenticator = authenticator |
28 | 28 | ||
29 | calendar = fetcher.execute() | 29 | calendar = fetcher.execute() |
30 | self.wfile.write(calendar.as_string()).close() | 30 | self.wfile.write(calendar.as_string()) |
31 | |||
32 | # This seems to work on Linux but not Mac OS. ~mcrute | ||
33 | if hasattr(self.wfile, 'close'): | ||
34 | self.wfile.close() | ||
31 | 35 | ||
32 | 36 | ||
33 | def get_un_pass(config): | 37 | def get_un_pass(config): |
@@ -49,7 +53,8 @@ def get_host_port(config): | |||
49 | 53 | ||
50 | 54 | ||
51 | def main(config_file='exchange.cfg'): | 55 | def main(config_file='exchange.cfg'): |
52 | config = ConfigParser().read(config_file) | 56 | config = ConfigParser() |
57 | config.read(config_file) | ||
53 | server_cfg = get_host_port(config) | 58 | server_cfg = get_host_port(config) |
54 | 59 | ||
55 | print('Exchange iCal Proxy Running on port {0:d}'.format(server_cfg[1])) | 60 | print('Exchange iCal Proxy Running on port {0:d}'.format(server_cfg[1])) |