summaryrefslogtreecommitdiff
path: root/exchange/wsgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'exchange/wsgi.py')
-rw-r--r--exchange/wsgi.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/exchange/wsgi.py b/exchange/wsgi.py
new file mode 100644
index 0000000..bf2baf0
--- /dev/null
+++ b/exchange/wsgi.py
@@ -0,0 +1,24 @@
1# vim: set filencoding=utf8
2"""
3Calendar WSGI App
4
5@author: Mike Crute (mcrute@ag.com)
6@organization: American Greetings Interactive
7@date: February 15, 2010
8"""
9
10from exchange.commands import FetchCalendar
11from exchange.authenticators import CookieSession
12
13
14class CalendarApp(object):
15
16 def __init__(self, exchange_server, user, password):
17 self.session = CookieSession(exchange_server,
18 username=user, password=password)
19
20 def __call__(self, environ, start_response):
21 start_response('200 OK', [])
22 command = FetchCalendar(self.session)
23 calendar = command.execute()
24 return calendar.as_string()