[cvs-annodex] commit (annodex): cmmlwiki/trunk/cgi-bin/cmmlwiki.cgi
conrad
nobody at lists.annodex.net
Fri May 12 18:02:29 EST 2006
Update of /var/local/lib/svn/annodex (new revision 2253)
Modified files:
cmmlwiki/trunk/cgi-bin/cmmlwiki.cgi
Log Message:
cgi cleanup: bunch together Response handling
Modified: cmmlwiki/trunk/cgi-bin/cmmlwiki.cgi
===================================================================
--- cmmlwiki/trunk/cgi-bin/cmmlwiki.cgi 2006-05-12 07:59:34 UTC (rev 2252)
+++ cmmlwiki/trunk/cgi-bin/cmmlwiki.cgi 2006-05-12 08:02:29 UTC (rev 2253)
@@ -61,22 +61,16 @@
def handle_special (handler, command, path_bits):
if (command == "ListAllItems"):
o = handler.list_all_items ()
- sys.stdout.write(Response(o).__str__())
elif (command == "ListHTML"):
o = handler.list_html ()
- sys.stdout.write(Response(o).__str__())
elif (command == "ListCMML"):
o = handler.list_cmml ()
- sys.stdout.write(Response(o).__str__())
elif (command == "ListMedia"):
o = handler.list_media ()
- sys.stdout.write(Response(o).__str__())
elif (command == "ListImages"):
o = handler.list_images ()
- sys.stdout.write(Response(o).__str__())
elif (command == "Search"):
o = handler.query ()
- sys.stdout.write(Response(o).__str__())
elif (command == "Story"):
try:
story_id = path_bits[1]
@@ -85,28 +79,24 @@
story_id = None
s = StoryList(handler)
o = HTMLPage(s)
- sys.stdout.write(Response(o).__str__())
elif (command == "RSS"):
o = RSSFeed(handler)
- sys.stdout.write(Response(o).__str__())
else:
o = handler.error ('Invalid request %s' % (command))
- sys.stdout.write(Response(o).__str__())
+ sys.stdout.write(Response(o).__str__())
+
def handle_edit (handler, command, path_bits):
if (command == "Channel"):
o = HTMLPage(Channel(handler))
- sys.stdout.write(Response(o).__str__())
elif (command == "Story"):
try:
story_id = path_bits[1]
except:
story_id = None
o = HTMLPage(StoryEdit(handler, story_id))
- sys.stdout.write(Response(o).__str__())
elif (command == "SaveStory"):
o = story.save (handler)
- sys.stdout.write(Response(o).__str__())
elif (command == "DeleteStory"):
try:
story_id = path_bits[1]
@@ -114,34 +104,27 @@
except:
pass
o = handler.main_page ()
- sys.stdout.write(Response(o).__str__())
elif (command == "SaveMedia"):
o = handler.save_media ()
- sys.stdout.write(Response(o).__str__())
elif (command == "DeleteItem"):
o = handler.delete_item ()
- sys.stdout.write(Response(o).__str__())
elif (command == "RenameItem"):
try:
iname = path_bits[1]
o = handler.rename_item (iname)
- sys.stdout.write(Response(o).__str__())
except:
o = handler.error ('Request %s failed' % (command))
- sys.stdout.write(Response(o).__str__())
elif (command == "Clip"):
o = handler.edit()
- sys.stdout.write(Response(o).__str__())
elif (command == "DeleteClip"):
o = handler.delete_clip()
- sys.stdout.write(Response(o).__str__())
elif (command == "AnchorURL"):
o = handler.update_field ('a_href')
- sys.stdout.write(Response(o).__str__())
else:
o = handler.error ('Invalid request %s' % (command))
- sys.stdout.write(Response(o).__str__())
+ sys.stdout.write(Response(o).__str__())
+
def handle_iname (handler, ext):
if (os.environ.has_key("HTTP_ACCEPT")):
@@ -163,11 +146,11 @@
sys.stdout.write(Response(o).__str__())
elif (handler.iname == ""):
- o = handler.main_page()
- sys.stdout.write(Response(o).__str__())
+ o = handler.main_page()
+ sys.stdout.write(Response(o).__str__())
else:
- o = handler.toc()
- sys.stdout.write(Response(o).__str__())
+ o = handler.toc()
+ sys.stdout.write(Response(o).__str__())
def main():
form = cgi.FieldStorage()
--
conrad
More information about the cvs-annodex
mailing list