<commit_before>import os.path
import configparser
import json


NOTERC = os.path.expanduser('~/.noterc')
CONFIG = configparser.ConfigParser()
CONFIG.read(NOTERC)


DATA = CONFIG.get('DEFAULT', 'data', fallback='~/.note')
DATA = os.path.expanduser(DATA)

EDITOR = CONFIG.get('DEFAULT', 'editor', fallback=os.getenv('EDITOR', 'nano'))
DATEFORMAT = CONFIG.get('DEFAULT', 'dateformat', fallback='YYYY-MM-dd HH:mm')
LOCALE = CONFIG.get('DEFAULT', 'locale', fallback='en_US')
RELDATES = CONFIG.getboolean('DEFAULT', 'reldates', fallback=False)
PYGMENTS_THEME = CONFIG.get('DEFAULT', 'pygments_theme', fallback='default')

IGNORE_SUFFIXES = CONFIG.get('DEFAULT', 'ignore_suffixes', fallback=[])
IGNORE_SUFFIXES = json.loads(IGNORE_SUFFIXES) if IGNORE_SUFFIXES else []<commit_msg>Global noterc support should work, see #1<commit_after>import os.path
import configparser
import json


GLOBAL_NOTERC = '/etc/noterc'
NOTERC = os.path.expanduser('~/.noterc')
CONFIG = configparser.ConfigParser()
CONFIG.read(GLOBAL_NOTERC)
CONFIG.read(NOTERC)


DATA = CONFIG.get('DEFAULT', 'data', fallback='~/.note')
DATA = os.path.expanduser(DATA)

EDITOR = CONFIG.get('DEFAULT', 'editor', fallback=os.getenv('EDITOR', 'nano'))
DATEFORMAT = CONFIG.get('DEFAULT', 'dateformat', fallback='YYYY-MM-dd HH:mm')
LOCALE = CONFIG.get('DEFAULT', 'locale', fallback='en_US')
RELDATES = CONFIG.getboolean('DEFAULT', 'reldates', fallback=False)
PYGMENTS_THEME = CONFIG.get('DEFAULT', 'pygments_theme', fallback='default')

IGNORE_SUFFIXES = CONFIG.get('DEFAULT', 'ignore_suffixes', fallback=[])
IGNORE_SUFFIXES = json.loads(IGNORE_SUFFIXES) if IGNORE_SUFFIXES else []
{'fraction_non_alphanumeric': 0.1694290976058932, 'fraction_numerical': 0.0006138735420503376, 'mean_word_length': 7.670212765957447, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1727330', 'n_tokens_mistral': 592, 'n_tokens_neox': 567, 'n_words': 105}