<commit_before>import os.path

"""
TODO:
pylokit.lokit.LoKitExportError: b'no output filter found for provided suffix'
Raised when trying to export to unsupported dest (eg. pptx -> txt)
"""

SUPPORTED_FORMATS = { 
    "pdf": {
        "path": "pdf",
        "fmt": "pdf",
    },
    "txt": {
        "path": "txt",
        "fmt": "txt",
    },
    "html": {
        "path": "html",
        "fmt": "html",
    }
}

SUPPORTED_MIMETYPES = {
    "application/ms-word": {
        "formats": ["pdf", "txt", "html"],
    }
}

DEBUG = True

LIBREOFFICE_PATH = "/usr/lib/libreoffice/program/" # for ubuntu 16.04

BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 

MEDIA_PATH = os.path.join(BASE_DIR, "media/")
MEDIA_URL = "/media/"

ORIGINAL_FILE_TTL = 60 * 10 # 10 minutes
RESULT_FILE_TTL = 60 * 60 * 24 # 24 hours
<commit_msg>Use DEBUG and LIBREOFFICE_PATH vars from env<commit_after>import os

"""
TODO:
pylokit.lokit.LoKitExportError: b'no output filter found for provided suffix'
Raised when trying to export to unsupported dest (eg. pptx -> txt)
"""

SUPPORTED_FORMATS = { 
    "pdf": {
        "path": "pdf",
        "fmt": "pdf",
    },
    "txt": {
        "path": "txt",
        "fmt": "txt",
    },
    "html": {
        "path": "html",
        "fmt": "html",
    }
}

SUPPORTED_MIMETYPES = {
    "application/ms-word": {
        "formats": ["pdf", "txt", "html"],
    }
}

DEBUG = os.environ.get("DEBUG", False)

LIBREOFFICE_PATH = os.environ.get("LIBREOFFICE_PATH", "/usr/lib/libreoffice/program/") # for ubuntu 16.04

BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 

MEDIA_PATH = os.path.join(BASE_DIR, "media/")
MEDIA_URL = "/media/"

ORIGINAL_FILE_TTL = 60 * 10 # 10 minutes
RESULT_FILE_TTL = 60 * 60 * 24 # 24 hours

{'fraction_non_alphanumeric': 0.17108294930875576, 'fraction_numerical': 0.020737327188940093, 'mean_word_length': 2.86, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '6284738', 'n_tokens_mistral': 704, 'n_tokens_neox': 658, 'n_words': 146}