<commit_before>"""Main application loop for the GUI program.

"""

import os
import sys

# We support both the PyQt4 (prevalent on Linux) and PySide (OS X) bindings for
# Qt. The qtcompat module provides the various shenanigans that are required to
# load one or the other. In this case if neight Qt bindings could be loaded,
# present a friendly error.
try:
  from ..util import qtcompat as qt
except ImportError as e:
  raise ImportError('Qt appears not to be installed: %s' % (str(e),))

# Extract the various Qt modules we want to use
QtGui = qt.import_module('QtGui')

# Annoyingly PySide and PyQt4 have different ways of dealing with .ui files at
# runtime.
if qt.USES_PYSIDE:
  from PySide.QtUiTools import QUiLoader
else:
  from PyQt4 import uic

# Support for logging.
import logging

from mainwidget import MainWidget

# Should make use of the real resource manager for this(!)
__resource_dir = os.path.dirname(__file__)

log = logging.getLogger()
<commit_msg>qtgui: fix mainwindow import on linux<commit_after>"""Main application loop for the GUI program.

"""

import os
import sys

# We support both the PyQt4 (prevalent on Linux) and PySide (OS X) bindings for
# Qt. The qtcompat module provides the various shenanigans that are required to
# load one or the other. In this case if neight Qt bindings could be loaded,
# present a friendly error.
try:
  from ..util import qtcompat as qt
except ImportError as e:
  raise ImportError('Qt appears not to be installed: %s' % (str(e),))

# Extract the various Qt modules we want to use
QtGui = qt.import_module('QtGui')

# Annoyingly PySide and PyQt4 have different ways of dealing with .ui files at
# runtime.
if qt.USES_PYSIDE:
  from PySide.QtUiTools import QUiLoader
else:
  from PyQt4 import uic

# Support for logging.
import logging

from .mainwidget import MainWidget

# Should make use of the real resource manager for this(!)
__resource_dir = os.path.dirname(__file__)

log = logging.getLogger()

{'fraction_non_alphanumeric': 0.07022900763358779, 'fraction_numerical': 0.0030534351145038168, 'mean_word_length': 4.327913279132791, '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': '2183457', 'n_tokens_mistral': 603, 'n_tokens_neox': 591, 'n_words': 275}