mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Split out the chardet library from the calibre package and upgrade it to version 2.0.1
This commit is contained in:
parent
b552d25fe0
commit
7233f134c6
@ -1,34 +1,15 @@
|
|||||||
######################## BEGIN LICENSE BLOCK ########################
|
#!/usr/bin/env python
|
||||||
# This library is free software; you can redistribute it and/or
|
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
from __future__ import (unicode_literals, division, absolute_import,
|
||||||
# License as published by the Free Software Foundation; either
|
print_function)
|
||||||
# version 2.1 of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This library is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Lesser General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
|
||||||
# License along with this library; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
######################### END LICENSE BLOCK #########################
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
__version__ = "1.0"
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import re, codecs
|
import re, codecs
|
||||||
|
from chardet import detect
|
||||||
|
|
||||||
def detect(aBuf):
|
|
||||||
import calibre.ebooks.chardet.universaldetector as universaldetector
|
|
||||||
u = universaldetector.UniversalDetector()
|
|
||||||
u.reset()
|
|
||||||
u.feed(aBuf)
|
|
||||||
u.close()
|
|
||||||
return u.result
|
|
||||||
|
|
||||||
# Added by Kovid
|
|
||||||
ENCODING_PATS = [
|
ENCODING_PATS = [
|
||||||
re.compile(r'<\?[^<>]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>',
|
re.compile(r'<\?[^<>]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>',
|
||||||
re.IGNORECASE),
|
re.IGNORECASE),
|
||||||
@ -63,7 +44,8 @@ def force_encoding(raw, verbose, assume_utf8=False):
|
|||||||
if chardet['confidence'] < 1 and assume_utf8:
|
if chardet['confidence'] < 1 and assume_utf8:
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
if chardet['confidence'] < 1 and verbose:
|
if chardet['confidence'] < 1 and verbose:
|
||||||
print 'WARNING: Encoding detection confidence %d%%'%(chardet['confidence']*100)
|
print('WARNING: Encoding detection confidence %d%%'%(
|
||||||
|
chardet['confidence']*100))
|
||||||
if not encoding:
|
if not encoding:
|
||||||
encoding = preferred_encoding
|
encoding = preferred_encoding
|
||||||
encoding = encoding.lower()
|
encoding = encoding.lower()
|
||||||
@ -113,7 +95,7 @@ def xml_to_unicode(raw, verbose=False, strip_encoding_pats=False,
|
|||||||
@return: (unicode, encoding used)
|
@return: (unicode, encoding used)
|
||||||
'''
|
'''
|
||||||
if not raw:
|
if not raw:
|
||||||
return u'', None
|
return '', None
|
||||||
raw, encoding = detect_xml_encoding(raw, verbose=verbose,
|
raw, encoding = detect_xml_encoding(raw, verbose=verbose,
|
||||||
assume_utf8=assume_utf8)
|
assume_utf8=assume_utf8)
|
||||||
if not isinstance(raw, unicode):
|
if not isinstance(raw, unicode):
|
@ -188,7 +188,7 @@ except:
|
|||||||
# chardet library auto-detects character encodings
|
# chardet library auto-detects character encodings
|
||||||
# Download from http://chardet.feedparser.org/
|
# Download from http://chardet.feedparser.org/
|
||||||
try:
|
try:
|
||||||
import calibre.ebooks.chardet as chardet # Changed by Kovid
|
import chardet
|
||||||
if _debug:
|
if _debug:
|
||||||
import chardet.constants
|
import chardet.constants
|
||||||
chardet.constants._debug = 1
|
chardet.constants._debug = 1
|
||||||
|
26
src/chardet/__init__.py
Executable file
26
src/chardet/__init__.py
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
######################## BEGIN LICENSE BLOCK ########################
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301 USA
|
||||||
|
######################### END LICENSE BLOCK #########################
|
||||||
|
|
||||||
|
__version__ = "2.0.1"
|
||||||
|
|
||||||
|
def detect(aBuf):
|
||||||
|
import universaldetector
|
||||||
|
u = universaldetector.UniversalDetector()
|
||||||
|
u.reset()
|
||||||
|
u.feed(aBuf)
|
||||||
|
u.close()
|
||||||
|
return u.result
|
0
src/calibre/ebooks/chardet/big5freq.py → src/chardet/big5freq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/big5freq.py → src/chardet/big5freq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/big5prober.py → src/chardet/big5prober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/big5prober.py → src/chardet/big5prober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/chardistribution.py → src/chardet/chardistribution.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/chardistribution.py → src/chardet/chardistribution.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/charsetgroupprober.py → src/chardet/charsetgroupprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/charsetgroupprober.py → src/chardet/charsetgroupprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/charsetprober.py → src/chardet/charsetprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/charsetprober.py → src/chardet/charsetprober.py
Normal file → Executable file
6
src/calibre/ebooks/chardet/codingstatemachine.py → src/chardet/codingstatemachine.py
Normal file → Executable file
6
src/calibre/ebooks/chardet/codingstatemachine.py → src/chardet/codingstatemachine.py
Normal file → Executable file
@ -13,19 +13,19 @@
|
|||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
# License as published by the Free Software Foundation; either
|
# License as published by the Free Software Foundation; either
|
||||||
# version 2.1 of the License, or (at your option) any later version.
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful,
|
# This library is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||||
# 02110-1301 USA
|
# 02110-1301 USA
|
||||||
######################### END LICENSE BLOCK #########################
|
######################### END LICENSE BLOCK #########################
|
||||||
|
|
||||||
from constants import eStart
|
from constants import eStart, eError, eItsMe
|
||||||
|
|
||||||
class CodingStateMachine:
|
class CodingStateMachine:
|
||||||
def __init__(self, sm):
|
def __init__(self, sm):
|
0
src/calibre/ebooks/chardet/constants.py → src/chardet/constants.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/constants.py → src/chardet/constants.py
Normal file → Executable file
8
src/calibre/ebooks/chardet/escprober.py → src/chardet/escprober.py
Normal file → Executable file
8
src/calibre/ebooks/chardet/escprober.py → src/chardet/escprober.py
Normal file → Executable file
@ -13,19 +13,19 @@
|
|||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
# License as published by the Free Software Foundation; either
|
# License as published by the Free Software Foundation; either
|
||||||
# version 2.1 of the License, or (at your option) any later version.
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful,
|
# This library is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||||
# 02110-1301 USA
|
# 02110-1301 USA
|
||||||
######################### END LICENSE BLOCK #########################
|
######################### END LICENSE BLOCK #########################
|
||||||
|
|
||||||
import constants
|
import constants, sys
|
||||||
from escsm import HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel, ISO2022KRSMModel
|
from escsm import HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel, ISO2022KRSMModel
|
||||||
from charsetprober import CharSetProber
|
from charsetprober import CharSetProber
|
||||||
from codingstatemachine import CodingStateMachine
|
from codingstatemachine import CodingStateMachine
|
||||||
@ -75,5 +75,5 @@ class EscCharSetProber(CharSetProber):
|
|||||||
self._mState = constants.eFoundIt
|
self._mState = constants.eFoundIt
|
||||||
self._mDetectedCharset = codingSM.get_coding_state_machine()
|
self._mDetectedCharset = codingSM.get_coding_state_machine()
|
||||||
return self.get_state()
|
return self.get_state()
|
||||||
|
|
||||||
return self.get_state()
|
return self.get_state()
|
2
src/calibre/ebooks/chardet/escsm.py → src/chardet/escsm.py
Normal file → Executable file
2
src/calibre/ebooks/chardet/escsm.py → src/chardet/escsm.py
Normal file → Executable file
@ -180,7 +180,7 @@ eError,eError,eError,eItsMe,eError,eError,eError,eError,# 38-3f
|
|||||||
eError,eError,eError,eError,eItsMe,eError,eStart,eStart,# 40-47
|
eError,eError,eError,eError,eItsMe,eError,eStart,eStart,# 40-47
|
||||||
)
|
)
|
||||||
|
|
||||||
ISO2022JPCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0)
|
ISO2022JPCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
||||||
|
|
||||||
ISO2022JPSMModel = {'classTable': ISO2022JP_cls,
|
ISO2022JPSMModel = {'classTable': ISO2022JP_cls,
|
||||||
'classFactor': 10,
|
'classFactor': 10,
|
0
src/calibre/ebooks/chardet/eucjpprober.py → src/chardet/eucjpprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/eucjpprober.py → src/chardet/eucjpprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euckrfreq.py → src/chardet/euckrfreq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euckrfreq.py → src/chardet/euckrfreq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euckrprober.py → src/chardet/euckrprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euckrprober.py → src/chardet/euckrprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euctwfreq.py → src/chardet/euctwfreq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euctwfreq.py → src/chardet/euctwfreq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euctwprober.py → src/chardet/euctwprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/euctwprober.py → src/chardet/euctwprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/gb2312freq.py → src/chardet/gb2312freq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/gb2312freq.py → src/chardet/gb2312freq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/gb2312prober.py → src/chardet/gb2312prober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/gb2312prober.py → src/chardet/gb2312prober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/hebrewprober.py → src/chardet/hebrewprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/hebrewprober.py → src/chardet/hebrewprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/jisfreq.py → src/chardet/jisfreq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/jisfreq.py → src/chardet/jisfreq.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/jpcntx.py → src/chardet/jpcntx.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/jpcntx.py → src/chardet/jpcntx.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langbulgarianmodel.py → src/chardet/langbulgarianmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langbulgarianmodel.py → src/chardet/langbulgarianmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langcyrillicmodel.py → src/chardet/langcyrillicmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langcyrillicmodel.py → src/chardet/langcyrillicmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langgreekmodel.py → src/chardet/langgreekmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langgreekmodel.py → src/chardet/langgreekmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langhebrewmodel.py → src/chardet/langhebrewmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langhebrewmodel.py → src/chardet/langhebrewmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langhungarianmodel.py → src/chardet/langhungarianmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langhungarianmodel.py → src/chardet/langhungarianmodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langthaimodel.py → src/chardet/langthaimodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/langthaimodel.py → src/chardet/langthaimodel.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/latin1prober.py → src/chardet/latin1prober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/latin1prober.py → src/chardet/latin1prober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/mbcharsetprober.py → src/chardet/mbcharsetprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/mbcharsetprober.py → src/chardet/mbcharsetprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/mbcsgroupprober.py → src/chardet/mbcsgroupprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/mbcsgroupprober.py → src/chardet/mbcsgroupprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/mbcssm.py → src/chardet/mbcssm.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/mbcssm.py → src/chardet/mbcssm.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/sbcharsetprober.py → src/chardet/sbcharsetprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/sbcharsetprober.py → src/chardet/sbcharsetprober.py
Normal file → Executable file
6
src/calibre/ebooks/chardet/sbcsgroupprober.py → src/chardet/sbcsgroupprober.py
Normal file → Executable file
6
src/calibre/ebooks/chardet/sbcsgroupprober.py → src/chardet/sbcsgroupprober.py
Normal file → Executable file
@ -14,19 +14,19 @@
|
|||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
# License as published by the Free Software Foundation; either
|
# License as published by the Free Software Foundation; either
|
||||||
# version 2.1 of the License, or (at your option) any later version.
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful,
|
# This library is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||||
# 02110-1301 USA
|
# 02110-1301 USA
|
||||||
######################### END LICENSE BLOCK #########################
|
######################### END LICENSE BLOCK #########################
|
||||||
|
|
||||||
import constants
|
import constants, sys
|
||||||
from charsetgroupprober import CharSetGroupProber
|
from charsetgroupprober import CharSetGroupProber
|
||||||
from sbcharsetprober import SingleByteCharSetProber
|
from sbcharsetprober import SingleByteCharSetProber
|
||||||
from langcyrillicmodel import Win1251CyrillicModel, Koi8rModel, Latin5CyrillicModel, MacCyrillicModel, Ibm866Model, Ibm855Model
|
from langcyrillicmodel import Win1251CyrillicModel, Koi8rModel, Latin5CyrillicModel, MacCyrillicModel, Ibm866Model, Ibm855Model
|
0
src/calibre/ebooks/chardet/sjisprober.py → src/chardet/sjisprober.py
Normal file → Executable file
0
src/calibre/ebooks/chardet/sjisprober.py → src/chardet/sjisprober.py
Normal file → Executable file
20
src/chardet/test.py
Executable file
20
src/chardet/test.py
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
import sys, glob
|
||||||
|
sys.path.insert(0, '..')
|
||||||
|
from chardet.universaldetector import UniversalDetector
|
||||||
|
|
||||||
|
count = 0
|
||||||
|
u = UniversalDetector()
|
||||||
|
for f in glob.glob(sys.argv[1]):
|
||||||
|
print f.ljust(60),
|
||||||
|
u.reset()
|
||||||
|
for line in file(f, 'rb'):
|
||||||
|
u.feed(line)
|
||||||
|
if u.done: break
|
||||||
|
u.close()
|
||||||
|
result = u.result
|
||||||
|
if result['encoding']:
|
||||||
|
print result['encoding'], 'with confidence', result['confidence']
|
||||||
|
else:
|
||||||
|
print '******** no result'
|
||||||
|
count += 1
|
||||||
|
print count, 'tests'
|
2
src/calibre/ebooks/chardet/universaldetector.py → src/chardet/universaldetector.py
Normal file → Executable file
2
src/calibre/ebooks/chardet/universaldetector.py → src/chardet/universaldetector.py
Normal file → Executable file
@ -81,7 +81,7 @@ class UniversalDetector:
|
|||||||
elif aBuf[:4] == '\x00\x00\xFF\xFE':
|
elif aBuf[:4] == '\x00\x00\xFF\xFE':
|
||||||
# 00 00 FF FE UCS-4, unusual octet order BOM (2143)
|
# 00 00 FF FE UCS-4, unusual octet order BOM (2143)
|
||||||
self.result = {'encoding': "X-ISO-10646-UCS-4-2143", 'confidence': 1.0}
|
self.result = {'encoding': "X-ISO-10646-UCS-4-2143", 'confidence': 1.0}
|
||||||
elif aBuf[:4] == '\xFF\xFE':
|
elif aBuf[:2] == '\xFF\xFE':
|
||||||
# FF FE UTF-16, little endian BOM
|
# FF FE UTF-16, little endian BOM
|
||||||
self.result = {'encoding': "UTF-16LE", 'confidence': 1.0}
|
self.result = {'encoding': "UTF-16LE", 'confidence': 1.0}
|
||||||
elif aBuf[:2] == '\xFE\xFF':
|
elif aBuf[:2] == '\xFE\xFF':
|
6
src/calibre/ebooks/chardet/utf8prober.py → src/chardet/utf8prober.py
Normal file → Executable file
6
src/calibre/ebooks/chardet/utf8prober.py → src/chardet/utf8prober.py
Normal file → Executable file
@ -13,19 +13,19 @@
|
|||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
# License as published by the Free Software Foundation; either
|
# License as published by the Free Software Foundation; either
|
||||||
# version 2.1 of the License, or (at your option) any later version.
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful,
|
# This library is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||||
# 02110-1301 USA
|
# 02110-1301 USA
|
||||||
######################### END LICENSE BLOCK #########################
|
######################### END LICENSE BLOCK #########################
|
||||||
|
|
||||||
import constants
|
import constants, sys
|
||||||
from constants import eStart, eError, eItsMe
|
from constants import eStart, eError, eItsMe
|
||||||
from charsetprober import CharSetProber
|
from charsetprober import CharSetProber
|
||||||
from codingstatemachine import CodingStateMachine
|
from codingstatemachine import CodingStateMachine
|
Loading…
x
Reference in New Issue
Block a user