main_file.py 429 B

123456789101112
  1. from .tool.func import *
  2. def main_file_2(conn, data):
  3. curs = conn.cursor()
  4. if re.search('\.txt$', data):
  5. if data == 'robots.txt' and not os.path.exists('robots.txt'):
  6. return flask.Response('User-agent: *\nDisallow: /\nAllow: /$\nAllow: /w/', mimetype='text/plain')
  7. else:
  8. return flask.send_from_directory('./', data)
  9. else:
  10. return redirect('/w/' + url_pas(wiki_set(2)))