Commits

Luke Plant committed 66053f1

Stopped passing 'prefix' around everywhere, since it is always the same.

Comments (0)

Files changed (1)

lukeplant_me_uk/bibleverses/update.py

     schemes = get_schemes()
     write_page(TOPICSPAGENAME, make_topics_page(verses, topictree, extras))
     build_schemes(verses, topictree, schemes)
-    write_page(SCHEMESPAGENAME, make_scheme_index_page(schemes, SCHEMESPAGENAMEPREFIX))
+    write_page(SCHEMESPAGENAME, make_scheme_index_page(schemes))
     for scheme in schemes:
-        write_scheme_page(SCHEMESPAGENAMEPREFIX, scheme, make_scheme_page(scheme))
+        write_scheme_page(scheme, make_scheme_page(scheme))
     for page, template, title in [('sources', 'sources.html', 'Sources and scripts'),
                                   ('index', 'index.html', 'Introduction')]:
         write_page(page, {'html': loader.render_to_string(template, 
     print "Topics: %d" % len(get_topic_entries(verses))
     print "Schemes: %d" % len(schemes)
 
-def scheme_page_name(prefix, scheme):
-    return prefix + scheme.name.title().replace(" ", "")
+def scheme_page_name(scheme):
+    return SCHEMESPAGENAMEPREFIX + scheme.name.title().replace(" ", "")
 
-def write_scheme_page(prefix, scheme, text):
-    write_page(scheme_page_name(prefix, scheme), text)
+def write_scheme_page(scheme, text):
+    write_page(scheme_page_name(scheme), text)
 
 def make_hebrew_verse_wiki(text):
     return u"""
 
     html = loader.render_to_string("scheme.html",
                                    {'title': u"Memorisation Scheme - %s" % scheme.name,
-                                    'pagename': FileWriter.make_html_filename(scheme_page_name(SCHEMESPAGENAMEPREFIX, scheme)),
+                                    'pagename': FileWriter.make_html_filename(scheme_page_name(scheme)),
                                     'menupages': menupages,
                                     'description': u"Bible memorisation scheme",
                                     'scheme': scheme,
     return {'wiki': wiki.getvalue(),
             'html': html}
 
-def make_scheme_index_page(schemes, prefix):
+def make_scheme_index_page(schemes):
     wiki = StringIO()
     wiki.write(u"""= Bible Memorisation Schemes =
 
 
 """)
     for scheme in schemes:        
-        wiki.write(u" * [wiki:%s %s]\n" % (scheme_page_name(prefix, scheme), scheme.name))
+        wiki.write(u" * [wiki:%s %s]\n" % (scheme_page_name(scheme), scheme.name))
     wiki.write(u"""
 
 ----
     # quick hack to get template to work nicely
     class HtmlScheme(Scheme):
         def html_filename(self):
-            return FileWriter.make_html_filename(scheme_page_name(prefix, self))
+            return FileWriter.make_html_filename(scheme_page_name(self))
     for s in schemes:
         s.__class__ = HtmlScheme
     # end monkey patch