text_dir -> data_dir
authorBernardo Innocenti <bernie@codewiz.org>
Sat, 29 Sep 2007 17:32:26 +0000 (19:32 +0200)
committerBernardo Innocenti <bernie@codewiz.org>
Sat, 29 Sep 2007 17:32:26 +0000 (19:32 +0200)
geekigeeki.conf.py
geekigeeki.py

index fcae5ac1191658373feb760f5ad19522bbd5a71e..2c7b9bee86832f643ed094d6dcb80528a795d655 100644 (file)
@@ -5,8 +5,7 @@ site_name = 'Codewiz'
 # otherwise, set to a URL that requires authentication
 privileged_url = 'https://www.codewiz.org/~bernie/wiki'
 
-data_dir = '/home/bernie/public_html/wiki'
-text_dir = path.join(data_dir, 'text')
+data_dir = '/home/bernie/public_html/wiki/data'
 css_url = '../wikidata/geekigeeki.css'  # optional stylesheet link
 
 history_url = '../wikigit/wiki.git'
index e110d8dafe256395a021980b7d8813eb0fa5d58c..abaa4338ee109158cc2fd4f90009423fe990e4f2 100755 (executable)
@@ -245,7 +245,7 @@ def make_index_key():
     return s
 
 def page_list():
-    return filter(word_re.match, os.listdir(text_dir))
+    return filter(word_re.match, os.listdir(data_dir))
 
 def send_footer(name, mod_string=None):
     if globals().get('debug_cgi', False):
@@ -567,10 +567,10 @@ class Page:
         return re.sub('([a-z])([A-Z])', r'\1 \2', self.page_name)
 
     def _text_filename(self):
-        return path.join(text_dir, self.page_name)
+        return path.join(data_dir, self.page_name)
 
     def _tmp_filename(self):
-        return path.join(text_dir, ('#' + self.page_name + '.' + `os.getpid()` + '#'))
+        return path.join(data_dir, ('#' + self.page_name + '.' + `os.getpid()` + '#'))
 
     def exists(self):
         try:
@@ -716,7 +716,7 @@ class Page:
         if post_edit_hook:
             # FIXME: what's the std way to perform shell quoting in python?
             cmd = ( post_edit_hook
-                + " '" + text_dir + '/' + self.page_name
+                + " '" + data_dir + '/' + self.page_name
                 + "' '" + remote_user()
                 + "' '" + remote_host() + "'"
             )
@@ -734,7 +734,7 @@ class Page:
 
 #TODO: merge into send_raw()
 def send_verbatim(filename, mime_type='application/octet-stream'):
-    pathname = path.join(text_dir, filename)
+    pathname = path.join(data_dir, filename)
     data = open(pathname, 'rb').read()
     emit_header(mime_type)
     sys.stdout.write(data)