From 1ef0274d5e544e83d31eb4b17d1bb517fdcb1c60 Mon Sep 17 00:00:00 2001 From: Bernardo Innocenti Date: Sat, 29 Sep 2007 19:32:26 +0200 Subject: [PATCH] text_dir -> data_dir --- geekigeeki.conf.py | 3 +-- geekigeeki.py | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/geekigeeki.conf.py b/geekigeeki.conf.py index fcae5ac..2c7b9be 100644 --- a/geekigeeki.conf.py +++ b/geekigeeki.conf.py @@ -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' diff --git a/geekigeeki.py b/geekigeeki.py index e110d8d..abaa433 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -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) -- 2.25.1