<commit_before>#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
# However, when used with the GPL version of PyQt the additional terms described in the PyQt GPL exception also apply

#
# Author: Riverbank Computing Limited
#------------------------------------------------------------------------------

""" Defines a source code editor and code editor factory, for the PyQt user
interface toolkit, useful for tools such as debuggers.
"""

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from PyQt4 import QtCore, QtGui, Qsci
from PyQt4.Qsci import QsciScintillaBase as QsciBase

from enthought.traits.api \
    import Str, Unicode, List, Int, Event, Bool, TraitError, on_trait_change

from enthought.traits.trait_base \
    import SequenceTypes

# FIXME: ToolkitEditorFactory is a proxy class defined here just for backward<commit_msg>* Added version check for QScintilla to CodeEditor.<commit_after>#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
# However, when used with the GPL version of PyQt the additional terms described in the PyQt GPL exception also apply

#
# Author: Riverbank Computing Limited
#------------------------------------------------------------------------------

""" Defines a source code editor and code editor factory, for the PyQt user
interface toolkit, useful for tools such as debuggers.
"""

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from PyQt4 import QtCore, QtGui, Qsci
from PyQt4.Qsci import QsciScintillaBase as QsciBase

# Only QScintilla version 2.3+ has support for custom lexing
if Qsci.QSCINTILLA_VERSION < 0x20300:
    raise RuntimeError, "QScintilla version 2.3 or higher needed for CodeEditor"

from enthought.traits.api \
    import Str, Unicode, List, Int, Event, Bool, TraitError, on_trait_change

from enthought.traits.trait_base \
    import SequenceTypes

# FIXME: ToolkitEditorFactory is a proxy class defined here just for backward
{'fraction_non_alphanumeric': 0.2937673680031759, 'fraction_numerical': 0.008733624454148471, 'mean_word_length': 1.61139896373057, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2123459', 'n_tokens_mistral': 588, 'n_tokens_neox': 550, 'n_words': 242}