Created
November 12, 2009 07:13
-
-
Save tkf/232680 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import cgi | |
## import cgitb | |
## cgitb.enable() | |
caldir_path = "../path/to/cal/" | |
calset = set(['cal1','cal2','cal3',]) | |
fs = cgi.FieldStorage() | |
cal = fs.getvalue('cal') | |
cal_path = os.path.join(caldir_path, cal + '.ics') | |
ctype = fs.getvalue('ctype') | |
if ctype == "plain": | |
print "Content-Type: text/plain\n" | |
elif ctype == "html": | |
print "Content-Type: text/html\n" | |
else: | |
print "Content-Type: text/calendar; charset=utf-8\n" | |
if cal in calset: | |
print file(cal_path).read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment