<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>wapsupport.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -8,38 +8,12 @@ Copyright (c) 2005  Dustin Sallings &lt;dustin@spy.net&gt;
 
 import os
 import sys
-import cgi
 import time
 import random
-import ConfigParser
 
 sys.path.append(&quot;/home/web/darcs/backpack&quot;)
 
-import backpack
-
-CONFIG_FILE=&quot;/usr/local/etc/backpack.conf&quot;
-
-HEADER=&quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;!DOCTYPE wml PUBLIC
-  &quot;-//WAPFORUM//DTD WML 1.1//EN&quot; &quot;http://www.wapforum.org/DTD/wml_1.1.xml&quot;&gt;
-&quot;&quot;&quot;
-
-# Get the config loaded
-conf=ConfigParser.ConfigParser()
-conf.read(CONFIG_FILE)
-
-def sendContent(data):
-    sys.stdout.write(&quot;Content-type: text/vnd.wap.wml\n&quot;)
-    toSend=HEADER + data
-    sys.stdout.write(&quot;Content-length: %d\n\n&quot; % len(toSend))
-    sys.stdout.write(toSend)
-
-def wml(s):
-    return &quot;&lt;wml&gt;%s&lt;/wml&gt;&quot; % (s,)
-
-def card(id, title, s):
-    return &quot;&quot;&quot;&lt;card id=&quot;%(id)s&quot; title=&quot;%(title)s&quot;&gt;&lt;p&gt;%(s)s&lt;/p&gt;&lt;/card&gt;&quot;&quot;&quot; % \
-        {'id': id, 'title': title, 's': s}
+from wapsupport import *
 
 def getNewForm():
     rv=&quot;&quot;&quot;
@@ -86,23 +60,5 @@ def doAdd(bp, fs):
     sendContent(wml(card(&quot;added&quot;, &quot;Added Reminder&quot;,
         &quot;Added a reminder for %s:  %s&quot; % (time.ctime(ts), msg))))
 
-def handleException(tvt):
-    &quot;&quot;&quot;Print out any exception that may occur.&quot;&quot;&quot;
-    type, value, tb = tvt
-
-    sendContent(wml(card(&quot;error&quot;, &quot;Error&quot;,
-        &quot;&lt;b&gt;Got an error:&lt;/b&gt;&lt;br/&gt;  %s&quot; % (value,))))
-
 if __name__ == '__main__':
-    fs=cgi.FieldStorage()
-    bp=backpack.Backpack(conf.get(&quot;backpack&quot;, &quot;url&quot;),
-        conf.get(&quot;backpack&quot;, &quot;key&quot;))
-
-    funcs={&quot;list&quot;: doList, &quot;add&quot;: doAdd}
-
-    action=funcs[fs.getvalue(&quot;action&quot;, &quot;list&quot;)]
-
-    try:
-        action(bp, fs)
-    except:
-        handleException(sys.exc_info())
+    doCallback({&quot;list&quot;: doList, &quot;add&quot;: doAdd})</diff>
      <filename>backpackWml.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>61455e5f0899dbaa96f9f5667e990b2d55019cd4</id>
    </parent>
  </parents>
  <author>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </author>
  <url>http://github.com/dustin/py-backpack/commit/28e4e87583d7142730d2c1def9909d0c9d608b5e</url>
  <id>28e4e87583d7142730d2c1def9909d0c9d608b5e</id>
  <committed-date>2005-08-25T23:54:25-07:00</committed-date>
  <authored-date>2005-08-25T23:54:25-07:00</authored-date>
  <message>refactored the wml stuff to be reused</message>
  <tree>7be8e61e509acdf944a026428321eb81ad9e1980</tree>
  <committer>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </committer>
</commit>
