<commit_before>#! /usr/bin/env python
### ensure folders exist ######################################################

import matplotlib

matplotlib.use("ps")  # important - images will be generated in worker threads

import sys
from PySide2 import QtWidgets, QtCore

app = QtWidgets.QApplication(sys.argv)

import os
import pathlib


#### import ###################################################################
# BEWARE OF CHANGING ORDER OF IMPORTS!!!!!!!!!

from .project import project_globals as g

g.app.write(app)
g.logger.load()

g.logger.log("info", "Startup", "PyCMDS is attempting startup")

from .project import style
from .project import widgets as pw
from .project import classes as pc
from .project import file_dialog_handler

from .hardware.hardware import all_initialized

import appdirs
import toml

import yaqc


### define ####################################################################


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


### version information #######################################################


# MAJOR.MINOR.PATCH (semantic versioning)
# major version changes may break backwards compatibility
__version__ = "0.11.0"

# add git branch, if appropriate
p = os.path.join(directory, ".git", "HEAD")
if os.path.isfile(p):
    with open(p) as _f:
        __branch__ = _f.readline().rstrip().split(r"/")[-1]
    if __branch__ != "master":
        __version__ += "-" + __branch__
else:
    __branch__ = None

g.version.write(__version__)


### main window ###############################################################


class MainWindow(QtWidgets.QMainWindow):
    shutdown = QtCore.Signal()
    queue_control = QtCore.Signal()

    def __init__(self):
        QtWidgets.QMainWindow.__init__(self, parent=None)
        self.config = toml.load(
            pathlib.Path(appdirs.user_config_dir("pycmds", "pycmds")) / "config.toml"
        )
        g.system_name.write(self.config["system_name"])
        g.main_window.write(self)
        g.shutdown.write(self.shutdown)
        self.setWindowTitle("PyCMDS %s" % __version__)
        # disable 'x'
        self.setWindowFlags(self.windowFlags() | QtCore.Qt.CustomizeWindowHint)
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowCloseButtonHint)
        # set size, position
        self.window_verti_size = 600
        self.window_horiz_size = 1000
        self.setGeometry(0, 0, self.window_horiz_size, self.window_verti_size)
        # self._center()
        self.resize(self.window_horiz_size, self.window_verti_size)<commit_msg>Use the version as specified in __version__.py (#290)<commit_after>#! /usr/bin/env python
### ensure folders exist ######################################################

import matplotlib

matplotlib.use("ps")  # important - images will be generated in worker threads

import sys
from PySide2 import QtWidgets, QtCore

app = QtWidgets.QApplication(sys.argv)

import os
import pathlib


#### import ###################################################################
# BEWARE OF CHANGING ORDER OF IMPORTS!!!!!!!!!

from .project import project_globals as g

g.app.write(app)
g.logger.load()

g.logger.log("info", "Startup", "PyCMDS is attempting startup")

from .project import style
from .project import widgets as pw
from .project import classes as pc
from .project import file_dialog_handler

from .hardware.hardware import all_initialized

import appdirs
import toml

import yaqc


### define ####################################################################


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


### version information #######################################################

from .__version__ import __version__

g.version.write(__version__)


### main window ###############################################################


class MainWindow(QtWidgets.QMainWindow):
    shutdown = QtCore.Signal()
    queue_control = QtCore.Signal()

    def __init__(self):
        QtWidgets.QMainWindow.__init__(self, parent=None)
        self.config = toml.load(
            pathlib.Path(appdirs.user_config_dir("pycmds", "pycmds")) / "config.toml"
        )
        g.system_name.write(self.config["system_name"])
        g.main_window.write(self)
        g.shutdown.write(self.shutdown)
        self.setWindowTitle("PyCMDS %s" % __version__)
        # disable 'x'
        self.setWindowFlags(self.windowFlags() | QtCore.Qt.CustomizeWindowHint)
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowCloseButtonHint)
        # set size, position
        self.window_verti_size = 600
        self.window_horiz_size = 1000
        self.setGeometry(0, 0, self.window_horiz_size, self.window_verti_size)
        # self._center()
        self.resize(self.window_horiz_size, self.window_verti_size)
{'fraction_non_alphanumeric': 0.22601591956430667, 'fraction_numerical': 0.005865102639296188, 'mean_word_length': 4.264608599779493, 'pattern_counts': {'":': 1, '<': 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': '3259179', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1379, 'n_words': 307}