# 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'
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):
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:
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() + "'"
)
#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)