<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,17 +2,29 @@ import web
 import webapp
 import petition
 import inspect, types, itertools, gzip, os
+from web.browser import AppBrowser
 
 single_pages = ('/', '/about', '/about/team', '/about/api', '/about/feedback', '/about/help',
                 '/contribute/', '/blog/',
                 '/lob/c/', '/lob/f/', '/lob/o/', '/lob/pa/', '/lob/pe/',
                 '/b/', '/e/', '/p/', '/c/', '/writerep/')
 
+b = AppBrowser(webapp.app)
+
+def test(klass):
+    index = klass().index()
+    for path in do_flatten(take(2, iter(index))):
+        try:
+            b.open(path)
+            assert(b.status == 200)
+            print b.status, path, klass
+        except:
+            print b.status, path, klass
+
 def get_class_index(klass, _test=False):
     try:
         if _test:
-            print klass
-            return take(5, iter(klass().index()))
+            return test(klass)  
         return klass().index()
     except AttributeError:
         return []
@@ -104,14 +116,13 @@ def write_sitemaps(data):
         write_sitemap(i, x)
 
 def create_index(index_dir, _test=False):
-    if not os.path.exists(index_dir):
-        os.mkdir(index_dir)
-
     data = getindex(webapp.app, _test)
     write_sitemaps(data)
-
-    dirs = [d for d in os.listdir('index') if os.path.isdir(os.path.join('index', d))]
-    write('index/index.html', str(make_index('index', [d+'/index.html' for d in dirs])))
+    
+    if not os.path.exists(index_dir):
+        os.mkdir(index_dir)
+    dirs = [d for d in os.listdir(index_dir) if os.path.isdir(os.path.join(index_dir, d))]
+    write(index_dir + '/index.html', str(make_index(index_dir, [d+'/index.html' for d in dirs])))
 
     for d in dirs:
         d = os.path.join('index', d)</diff>
      <filename>utils/index.py</filename>
    </modified>
    <modified>
      <diff>@@ -68,46 +68,32 @@ urls = (
 )
 
 class index:
-    def index(self): return ['/']
-
     def GET(self):
         return render.index()
 
 class about:
-    def index(self): return ['/about/']
-
     def GET(self, endslash=None):
         if not endslash: raise web.seeother('/about/')
         return render.about()
 
 class aboutapi:
-    def index(self): return ['/about/api']
-
     def GET(self):
         return render.about_api()
 
 class aboutteam:
-    def index(self): return ['/about/team']
-
     def GET(self):
         return render.about_team()
 
 class abouthelp:
-    def index(self): return ['/about/help']
-
     def GET(self):
         return render.about_help()
 
 class contribute:
-    def index(self): return ['/contribute/']
-
     def GET(self, endslash=None):
         if not endslash: raise web.seeother('/contribute/')
         return render.contribute()
 
 class feedback:
-    def index(self): return ['/feedback']
-
     def GET(self):
         return render.feedback()
 
@@ -391,7 +377,12 @@ class occupation_committees:
 
 class contributions:
     &quot;&quot;&quot;from a corp to a pol&quot;&quot;&quot;
-    def index(self): return ['/contrib/']
+    def index(self):
+        return ('/contrib/?from=%s&amp;to=%s' % (c.frm, c.to) \
+                    for c in db.query(&quot;&quot;&quot;SELECT cn.employer_stem as frm, p.id as to
+                            FROM contribution cn, committee cm, politician_fec_ids pfi, politician p 
+                            WHERE cn.recipient_id = cm.id AND cm.candidate_id = pfi.fec_id 
+                            AND pfi.politician_id = p.id&quot;&quot;&quot;))
 
     def GET(self, img=None):
         i = web.input()
@@ -757,11 +748,9 @@ class dproperty:
         def get_number_columns(table):
             return [cname for cname, c in table.columns.iteritems() if c.sql_type in ('int', 'real')]
 
-        l = []
         for prefix, table in table_map.iteritems():
             table = getattr(schema, table.title())
-            l.append(['/by/'.join([prefix, col]) for col in get_number_columns(table)])
-        return l
+            yield ('/%s/by/%s' % (prefix, col) for col in get_number_columns(table))
 
     def GET(self, table, what):
         try:</diff>
      <filename>webapp.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6770141097799c54a48cbcafdd60f5018c307883</id>
    </parent>
  </parents>
  <author>
    <name>Devi</name>
    <email>asldevi@gmail.com</email>
  </author>
  <url>http://github.com/aaronsw/watchdog/commit/0c35ab7a8fea6c45572c27aefe87ceffdf02e111</url>
  <id>0c35ab7a8fea6c45572c27aefe87ceffdf02e111</id>
  <committed-date>2009-04-08T02:09:15-07:00</committed-date>
  <authored-date>2009-04-08T02:09:15-07:00</authored-date>
  <message>better testing and bug fixes in creating index</message>
  <tree>d3d8d2c0ed9318ee2c9c9555d413e425bc02ef1a</tree>
  <committer>
    <name>Devi</name>
    <email>asldevi@gmail.com</email>
  </committer>
</commit>
