<commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 
# PCEF - Python/Qt Code Editing Framework
# Copyright 2013, <NAME> <<EMAIL>>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Integrates the generic editor using the pcef qt designer plugin.
"""
import logging
logging.basicConfig(level=logging.INFO)
import os
import sys
os.environ.setdefault("QT_API", "PyQt")
from pcef.qt import QtCore, QtGui
from pcef.core import FoldingIndicator
if sys.version_info[0] == 3:
    from examples.gui_integration.ui.python_editor_ui3 import Ui_MainWindow
    logging.info("Using python3")
else:
    from examples.gui_integration.ui.python_editor_ui import Ui_MainWindow
    logging.info("Using python2")
 

class PythonEditorWindow(QtGui.QMainWindow, Ui_MainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.setupUi(self)
        self.editor.foldingPanel.addIndicator(FoldingIndicator(22, 30))
        self.editor.dirtyChanged.connect(self.actionSave.setEnabled)
        self.actionSave.triggered.connect(self.editor.saveToFile)
        mnu = QtGui.QMenu("Edit", self.menubar)
        mnu.addActions(self.editor.actions())
        self.menubar.addMenu(mnu)
        # Add modes to the modes menu
        for k, v in self.editor.modes().items():<commit_msg>Add more folding indicators (testing the folding panel)<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 
# PCEF - Python/Qt Code Editing Framework
# Copyright 2013, <NAME> <<EMAIL>>
#
# This software is released under the LGPLv3 license.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Integrates the generic editor using the pcef qt designer plugin.
"""
import logging
logging.basicConfig(level=logging.INFO)
import os
import sys
os.environ.setdefault("QT_API", "PyQt")
from pcef.qt import QtCore, QtGui
from pcef.core import FoldingIndicator
if sys.version_info[0] == 3:
    from examples.gui_integration.ui.python_editor_ui3 import Ui_MainWindow
    logging.info("Using python3")
else:
    from examples.gui_integration.ui.python_editor_ui import Ui_MainWindow
    logging.info("Using python2")
 

class PythonEditorWindow(QtGui.QMainWindow, Ui_MainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.setupUi(self)
        self.editor.foldingPanel.addIndicator(FoldingIndicator(22, 30))
        self.editor.foldingPanel.addIndicator(FoldingIndicator(25, 28))
        self.editor.foldingPanel.addIndicator(FoldingIndicator(50, 60))
        self.editor.dirtyChanged.connect(self.actionSave.setEnabled)
        self.actionSave.triggered.connect(self.editor.saveToFile)
        mnu = QtGui.QMenu("Edit", self.menubar)
        mnu.addActions(self.editor.actions())
        self.menubar.addMenu(mnu)
        # Add modes to the modes menu
        for k, v in self.editor.modes().items():
{'fraction_non_alphanumeric': 0.10952689565780946, 'fraction_numerical': 0.012961762799740765, 'mean_word_length': 3.9471153846153846, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5312742', 'n_tokens_mistral': 999, 'n_tokens_neox': 966, 'n_words': 236}