<commit_before># -*- coding: utf-8 -*-
import os, datetime, uuid
import web
import config, crypto, store

urls = (
  '/', 'index',
  '/reply/', 'reply',
  '/([a-f0-9]+)/', 'col',
  '/([a-f0-9]+)/([0-9]+\.[0-9]+(?:_msg|_doc|)\.gpg)', 'doc'
)

render = web.template.render(config.JOURNALIST_TEMPLATES_DIR, base='base')

class index:
    def GET(self):
        dirs = os.listdir(config.STORE_DIR)
        cols = []
        for d in dirs:
            if not os.listdir(store.path(d)): continue
            cols.append(web.storage(name=d, codename=crypto.displayid(d), date=
              str(datetime.datetime.fromtimestamp(
                os.stat(store.path(d)).st_mtime
              )).split('.')[0]
            ))
        cols.sort(lambda x,y: cmp(x.date, y.date), reverse=True)

        web.header('Cache-Control', 'no-cache, no-store, must-revalidate')
        web.header('Pragma', 'no-cache')
        web.header('Expires', '-1')
        return render.index(cols)

class col:
    def GET(self, sid):
        fns = os.listdir(store.path(sid))<commit_msg>Fix regexes for submissions and downloads<commit_after># -*- coding: utf-8 -*-
import os, datetime, uuid
import web
import config, crypto, store

urls = (
  '/', 'index',
  '/reply/', 'reply',
  '/([A-Z1-7]+)/', 'col',
  '/([A-Z1-7]+)/([0-9]+\.[0-9]+(?:_msg|_doc|)\.gpg)', 'doc'
)

render = web.template.render(config.JOURNALIST_TEMPLATES_DIR, base='base')

class index:
    def GET(self):
        dirs = os.listdir(config.STORE_DIR)
        cols = []
        for d in dirs:
            if not os.listdir(store.path(d)): continue
            cols.append(web.storage(name=d, codename=crypto.displayid(d), date=
              str(datetime.datetime.fromtimestamp(
                os.stat(store.path(d)).st_mtime
              )).split('.')[0]
            ))
        cols.sort(lambda x,y: cmp(x.date, y.date), reverse=True)

        web.header('Cache-Control', 'no-cache, no-store, must-revalidate')
        web.header('Pragma', 'no-cache')
        web.header('Expires', '-1')
        return render.index(cols)

class col:
    def GET(self, sid):
        fns = os.listdir(store.path(sid))
{'fraction_non_alphanumeric': 0.19345794392523363, 'fraction_numerical': 0.010280373831775701, 'mean_word_length': 2.4756493506493507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2757717', 'n_tokens_mistral': 773, 'n_tokens_neox': 764, 'n_words': 138}