<commit_before>(import
    [bottle         [*template-path* template]]
    [hashlib        [sha1]]
    [logging        [getLogger basicConfig *debug* *info*]]
    [logging.config [dictConfig]]
    [os             [environ]]
    [re]
    [sys            [stdout]]
    [codecs         [getwriter]]
    [os.path        [join abspath]])

(setv log (getLogger --name--))

(setv stdout ((getwriter "utf-8") stdout))

(def *store-path* (.get environ "CONTENT_PATH" "pages"))

(def *theme-path* (.get environ "THEME_PATH" "themes/wiki"))

(def *feed-css* (.get environ "FEED_CSS" "themes/wiki/static/css/rss.css"))

(def *feed-ttl* 1800); in seconds

(def *rss-date-format* "%a, %d %b %Y %H:%M:%S %z")

(def *site-name* (.get environ "SITE_NAME" "Sushy"))

(def *site-description* (.get environ "SITE_DESCRIPTION" "A Sushy-powered site"))

(def *site-copyright* (.get environ "SITE_COPYRIGHT" "CC Attribution-NonCommercial-NoDerivs 3.0"))

(def *static-path* (join *theme-path* "static"))

(def *view-path* (join *theme-path* "views"))

(def *bind-address* (.get environ "BIND_ADDRESS" "127.0.0.1"))

(def *http-port* (.get environ "PORT" "8080"))

(def *page-route-base* "/space")

(def *page-media-base* "/media")

(def *home-page* (+ *page-route-base* "/HomePage"))

(def *debug-mode* (= (.lower (.get environ "DEBUG" "false")) "true"))

(def *profiler* (= (.lower (.get environ "PROFILER" "false")) "true"))

(def *aliasing-chars* [" " "." "-" "_"])

(def *alias-page* "meta/Aliases")

(def *interwiki-page* "meta/InterWikiMap")

(def *exclude-from-feeds* (.compile re "^meta.*"))

(def *base-types*
    {".txt"      "text/x-textile"; TODO: this should be reverted to text/plain later in the testing cycle
     ".htm"      "text/html"
     ".html"     "text/html"
     ".rst"      "text/x-rst"
     ".md"       "text/x-markdown"
     ".mkd"      "text/x-markdown"
     ".mkdn"     "text/x-markdown"
     ".markdown" "text/x-markdown"
     ".textile"  "text/x-textile"})
     
(def *base-filenames*
    (list-comp (% "index%s" t) [t (.keys *base-types*)]))

(def *base-page* "From: %(author)s\nDate: %(date)s\nContent-Type: %(markup)s\nContent-Encoding: utf-8\nTitle: %(title)s\nKeywords: %(keywords)s\nCategories: %(categories)s\nTags: %(tags)s\n%(_headers)s\n\n%(content)s")

(def *ignored-folders* ["CVS" ".hg" ".svn" ".git" ".AppleDouble" ".TemporaryItems"])

; TODO: cleanup the logging dict
<commit_msg>thumbnail sizes<commit_after>(import
    [bottle         [*template-path* template]]
    [hashlib        [sha1]]
    [logging        [getLogger basicConfig *debug* *info*]]
    [logging.config [dictConfig]]
    [os             [environ]]
    [re]
    [sys            [stdout]]
    [codecs         [getwriter]]
    [os.path        [join abspath]])

(setv log (getLogger --name--))

(setv stdout ((getwriter "utf-8") stdout))

(def *store-path* (.get environ "CONTENT_PATH" "pages"))

(def *theme-path* (.get environ "THEME_PATH" "themes/wiki"))

(def *feed-css* (.get environ "FEED_CSS" "themes/wiki/static/css/rss.css"))

(def *feed-ttl* 1800); in seconds

(def *rss-date-format* "%a, %d %b %Y %H:%M:%S %z")

(def *site-name* (.get environ "SITE_NAME" "Sushy"))

(def *site-description* (.get environ "SITE_DESCRIPTION" "A Sushy-powered site"))

(def *site-copyright* (.get environ "SITE_COPYRIGHT" "CC Attribution-NonCommercial-NoDerivs 3.0"))

(def *static-path* (join *theme-path* "static"))

(def *view-path* (join *theme-path* "views"))

(def *bind-address* (.get environ "BIND_ADDRESS" "127.0.0.1"))

(def *http-port* (.get environ "PORT" "8080"))

(def *page-route-base* "/space")

(def *page-media-base* "/media")

(def *home-page* (+ *page-route-base* "/HomePage"))

(def *debug-mode* (= (.lower (.get environ "DEBUG" "false")) "true"))

(def *profiler* (= (.lower (.get environ "PROFILER" "false")) "true"))

(def *thumbnail-sizes* [(, 320 240) (, 640 320) (, 1280 720)])

(def *aliasing-chars* [" " "." "-" "_"])

(def *alias-page* "meta/Aliases")

(def *interwiki-page* "meta/InterWikiMap")

(def *exclude-from-feeds* (.compile re "^meta.*"))

(def *base-types*
    {".txt"      "text/x-textile"; TODO: this should be reverted to text/plain later in the testing cycle
     ".htm"      "text/html"
     ".html"     "text/html"
     ".rst"      "text/x-rst"
     ".md"       "text/x-markdown"
     ".mkd"      "text/x-markdown"
     ".mkdn"     "text/x-markdown"
     ".markdown" "text/x-markdown"
     ".textile"  "text/x-textile"})
     
(def *base-filenames*
    (list-comp (% "index%s" t) [t (.keys *base-types*)]))

(def *base-page* "From: %(author)s\nDate: %(date)s\nContent-Type: %(markup)s\nContent-Encoding: utf-8\nTitle: %(title)s\nKeywords: %(keywords)s\nCategories: %(categories)s\nTags: %(tags)s\n%(_headers)s\n\n%(content)s")

(def *ignored-folders* ["CVS" ".hg" ".svn" ".git" ".AppleDouble" ".TemporaryItems"])

; TODO: cleanup the logging dict

{'fraction_non_alphanumeric': 0.21501846532622076, 'fraction_numerical': 0.011694706606483382, 'mean_word_length': 3.3487957181088315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1405746', 'n_tokens_mistral': 1972, 'n_tokens_neox': 1878, 'n_words': 429}