<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals
"""

:StyleSheet:
    https://github.com/ColinDuquesnoy/QDarkStyleSheet

:dependent:
    * toml
    * qdarkstyle
"""
import os
import sys
# os.environ.setdefault("QT_API", 'pyside')
# from qtpy.QtGui import *
from qtpy.QtCore import *
from qtpy.QtWidgets import *

import qdarkstyle
from .main_window import MainWindow
import logging

HOME_DIR = os.path.join(os.path.expanduser('~'), ".sphinx-explorer")

__version__ = 0.9


def main():
    # if sys.stdout.encoding is None:
    #     sys.stdout = codecs.open("sphinx-exploere.log", "w", "utf-8")
    # if sys.stderr.encoding is None:
    #     sys.stderr = codecs.open("sphinx-exploere_error.log", "w", "utf-8")
    logging.basicConfig()

    app = QApplication(sys.argv)
    app.setStyleSheet(qdarkstyle.load_stylesheet(False))

    translator = QTranslator()
    # noinspection PyArgumentList
    translator.load("i18n/sphinx_explorer_{}".format(QLocale.system().name()))
    app.installTranslator(translator)

    sys_dir = os.path.dirname(sys.argv[0])
    window = MainWindow(sys_dir, HOME_DIR)
    window.show()

    sys.exit(app.exec_())<commit_msg>qt5 <commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals
"""

:StyleSheet:
    https://github.com/ColinDuquesnoy/QDarkStyleSheet

:dependent:
    * toml
    * qdarkstyle
"""
import os
import sys
# os.environ.setdefault("QT_API", 'pyside')
# from qtpy.QtGui import *
from qtpy.QtCore import *
from qtpy.QtWidgets import *

import qdarkstyle
from .main_window import MainWindow
import logging

HOME_DIR = os.path.join(os.path.expanduser('~'), ".sphinx-explorer")

__version__ = 0.9


def main():
    # if sys.stdout.encoding is None:
    #     sys.stdout = codecs.open("sphinx-exploere.log", "w", "utf-8")
    # if sys.stderr.encoding is None:
    #     sys.stderr = codecs.open("sphinx-exploere_error.log", "w", "utf-8")
    logging.basicConfig()

    app = QApplication(sys.argv)
    app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
    # app.setStyleSheet(qdarkstyle.load_stylesheet(False))

    translator = QTranslator()
    # noinspection PyArgumentList
    translator.load("i18n/sphinx_explorer_{}".format(QLocale.system().name()))
    app.installTranslator(translator)

    sys_dir = os.path.dirname(sys.argv[0])
    window = MainWindow(sys_dir, HOME_DIR)
    window.show()

    sys.exit(app.exec_())
{'fraction_non_alphanumeric': 0.14229713837710703, 'fraction_numerical': 0.007056056448451587, 'mean_word_length': 4.003921568627451, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '636383', 'n_tokens_mistral': 925, 'n_tokens_neox': 908, 'n_words': 159}