% (url, url, name)
def link_inline_glob(pattern, descr=None, kvargs={}):
- os.chdir(config_get('data_dir', 'data'))
s = ''
for name in glob.glob(pattern):
s += link_inline(name, descr, kvargs)
if search_re is None:
# FIXME: WikiWord is too restrictive now!
search_re = re.compile(r"^\b((([A-Z][a-z0-9]+){2,}/)*([A-Z][a-z0-9]+){2,})\b$")
- return sorted(filter(search_re.match, os.listdir(dirname or config_get('data_dir', 'data'))))
+ return sorted(filter(search_re.match, os.listdir(dirname or '.')))
def send_footer(mod_string=None):
if config_get('debug_cgi', False):
return re.sub('([a-z])([A-Z])', r'\1 \2', self.page_name)
def _filename(self):
- return os.path.join(config_get('data_dir', 'data'), self.page_name)
+ return self.page_name
def _tmp_filename(self):
- return os.path.join(config_get('data_dir', 'data'), ('#' + self.page_name.replace('/','_') + '.' + str(os.getpid()) + '#'))
+ return self.page_name + '.tmp' + str(os.getpid()) + '#'
def exists(self):
try:
import subprocess
cmd = [
config_get('post_edit_hook'),
- os.path.join(config_get('data_dir', 'data'), self.page_name), remote_user(),
+ self.page_name, remote_user(),
remote_host(), changelog ]
child = subprocess.Popen(cmd, stdout=subprocess.PIPE, close_fds=True)
output = child.stdout.read()
try:
exec(open("geekigeeki.conf.py").read())
+ os.chdir(config_get('data_dir', 'data'))
form = cgi.FieldStorage()
action = form.getvalue('a', 'get')
handler = globals().get('handle_' + action)