summaryrefslogtreecommitdiff
path: root/exchange/wsgi.py
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2010-02-15 22:12:24 -0500
committerMike Crute <mcrute@gmail.com>2010-02-15 22:12:24 -0500
commitf75f35fda0509f93378a74a395bc212b35d83c5f (patch)
treea9156779d001bf4913accbdd0ed9ec56c4898f31 /exchange/wsgi.py
parenta0013ea1f8a2dd374d3afd6349b89d7c7ab01bce (diff)
downloadcalendar_proxy-f75f35fda0509f93378a74a395bc212b35d83c5f.tar.bz2
calendar_proxy-f75f35fda0509f93378a74a395bc212b35d83c5f.tar.xz
calendar_proxy-f75f35fda0509f93378a74a395bc212b35d83c5f.zip
Converting webapp to a wsgi app.
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()