<commit_before>#!/bin/python3
import sys, os, tempfile, zlib, configparser
from itertools import chain
from functools import partial
from fractions import Fraction

CurPage = None
CurStaff = None
CurMultiVoice = None
Config = configparser.ConfigParser()
Config.read("settings.ini")

#FIXME cleanup
if sys.argv.__len__() > 1:
    IF = sys.argv[1]
else:
    import tkinter
    from tkinter import filedialog
    tkinter.Tk().withdraw()

    IF = filedialog.askopenfilename(filetypes=[("NWC Text File", "*.nwctxt")])

if sys.argv.__len__() > 2:
    OF = sys.argv[2]
else:
    OF = os.path.splitext(IF)[0]

if OF == "-":
    OF = sys.stdout
else:
    OF = os.path.abspath(OF)

    if os.path.exists(OF + ".ly"):
        OF = open(tempfile.mkstemp(prefix=OF + "-", suffix=".ly", text=True)[0], "w")
    else:
        OF = open(OF + ".ly", "w")

GRACE = ["acciaccatura", "appoggiatura"][0]
CLEFDIFF = {"treble": 0, "bass": 12, "tenor": 8, "alto": 6, "percussion": 6}

NOTES = {"treble":     ['b', 'c', 'd', 'e', 'f', 'g', 'a'],<commit_msg>updated map to settings.ini<commit_after>#!/bin/python3
import sys, os, tempfile, zlib, configparser
from itertools import chain
from functools import partial
from fractions import Fraction

CurPage = None
CurStaff = None
CurMultiVoice = None
Config = configparser.ConfigParser()
Config.read(os.path.join(os.path.dirname(os.path.realpath(__file__)), "settings.ini"))


#FIXME cleanup
if sys.argv.__len__() > 1:
    IF = sys.argv[1]
else:
    import tkinter
    from tkinter import filedialog
    tkinter.Tk().withdraw()

    IF = filedialog.askopenfilename(filetypes=[("NWC Text File", "*.nwctxt")])

if sys.argv.__len__() > 2:
    OF = sys.argv[2]
else:
    OF = os.path.splitext(IF)[0]

if OF == "-":
    OF = sys.stdout
else:
    OF = os.path.abspath(OF)

    if os.path.exists(OF + ".ly"):
        OF = open(tempfile.mkstemp(prefix=OF + "-", suffix=".ly", text=True)[0], "w")
    else:
        OF = open(OF + ".ly", "w")

GRACE = ["acciaccatura", "appoggiatura"][0]
CLEFDIFF = {"treble": 0, "bass": 12, "tenor": 8, "alto": 6, "percussion": 6}

NOTES = {"treble":     ['b', 'c', 'd', 'e', 'f', 'g', 'a'],
{'fraction_non_alphanumeric': 0.18691588785046728, 'fraction_numerical': 0.013084112149532711, 'mean_word_length': 3.7054945054945057, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 7, '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': '1236520', 'n_tokens_mistral': 840, 'n_tokens_neox': 808, 'n_words': 201}