Commits

Luke Plant committed ee4c398

Moved config data to separate module

Comments (0)

Files changed (4)

bibleverses/config.py

+DATABASE = "/home/luke/misc/notes/db/trac.db"
+OUTPUTHTMLDIR = "/home/luke/httpd/lukeplant.me.uk/src/bible"
+
+VERSEYAMLPAGENAME = 'BibleMemorisationYaml'
+TOPICYAMLPAGENAME = 'BibleMemorisationTopicYaml'
+SCHEMEYAMLPAGENAME = 'BibleMemorisationSchemeYaml'
+
+VERSESPAGENAME = "BibleMemorisationVerses"
+TOPICSPAGENAME = "BibleMemorisationTopics"
+SCHEMESPAGENAME = "BibleMemorisationSchemes"
+

bibleverses/read.py

 # but we simply build custom objects for everything, and initialise
 # using 'foo = unicode(yaml_foo_data)', which is safe.
 
-VERSEYAMLPAGENAME = 'BibleMemorisationYaml'
-TOPICYAMLPAGENAME = 'BibleMemorisationTopicYaml'
-SCHEMEYAMLPAGENAME = 'BibleMemorisationSchemeYaml'
-DATABASE = "/home/luke/misc/notes/db/trac.db"
+from config import VERSEYAMLPAGENAME, TOPICYAMLPAGENAME, SCHEMEYAMLPAGENAME, DATABASE
 
 from sword import get_bible_text, correct_verse_ref
 

bibleverses/update.py

 #!/usr/bin/env python
 
-from read import get_verses, get_topic_entries, DATABASE, populate_topic_tree, get_topictree, get_schemes
+from read import get_verses, get_topic_entries, populate_topic_tree, get_topictree, get_schemes
 from build import build_schemes
 from writewiki import write_page
 from StringIO import StringIO
 
-
-VERSESPAGENAME = "BibleMemorisationVerses"
-TOPICSPAGENAME = "BibleMemorisationTopics"
-SCHEMESPAGENAME = "BibleMemorisationSchemes"
+from config import VERSESPAGENAME, TOPICSPAGENAME, SCHEMESPAGENAME
 
 def write_pages():
     verses = get_verses()
         buf.write(u"\n")
     return buf.getvalue()
 
-
 def bible_entry(entry):
     return u"bible:\"%s\" -- %s\n" % (entry.verse, entry.comment)
 
             for e in node.entries:
                 buf.write(u"%s   * %s" % (padding, bible_entry(e)))
         for n in node.nodes:
+            # This is an extra line
             print_topic_node(n, buf, indentation_level+2)
     
     # Skip the root node

bibleverses/writewiki.py

 #!/usr/bin/env python
 
-from read import DATABASE
+from config import DATABASE
 import sqlite3
 
 
         raise NotImplementedError("Haven't implemented 'add_new_version=True' yet.")
     c.commit()
     c.close()
-    
+