~ubuntu-branches/debian/wheezy/calibre/wheezy

« back to all changes in this revision

Viewing changes to src/calibre/ebooks/chardet/euckrprober.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-01-07 11:22:54 UTC
  • mfrom: (29.4.10 precise)
  • Revision ID: package-import@ubuntu.com-20120107112254-n1syr437o46ds802
Tags: 0.8.34+dfsg-1
* New upstream version. (Closes: #654751)
* debian/rules: Do not install calibre copy of chardet; instead, add
  build/binary python-chardet dependency.
* Add disable_plugins.py: Disable plugin dialog. It uses a totally
  non-authenticated and non-trusted way of installing arbitrary code.
  (Closes: #640026)
* debian/rules: Install with POSIX locale, to avoid installing translated
  manpages into the standard locations. (Closes: #646674)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
######################## BEGIN LICENSE BLOCK ########################
2
 
# The Original Code is mozilla.org code.
3
 
#
4
 
# The Initial Developer of the Original Code is
5
 
# Netscape Communications Corporation.
6
 
# Portions created by the Initial Developer are Copyright (C) 1998
7
 
# the Initial Developer. All Rights Reserved.
8
 
#
9
 
# Contributor(s):
10
 
#   Mark Pilgrim - port to Python
11
 
#
12
 
# This library is free software; you can redistribute it and/or
13
 
# modify it under the terms of the GNU Lesser General Public
14
 
# License as published by the Free Software Foundation; either
15
 
# version 2.1 of the License, or (at your option) any later version.
16
 
17
 
# This library is distributed in the hope that it will be useful,
18
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20
 
# Lesser General Public License for more details.
21
 
22
 
# You should have received a copy of the GNU Lesser General Public
23
 
# License along with this library; if not, write to the Free Software
24
 
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25
 
# 02110-1301  USA
26
 
######################### END LICENSE BLOCK #########################
27
 
 
28
 
from mbcharsetprober import MultiByteCharSetProber
29
 
from codingstatemachine import CodingStateMachine
30
 
from chardistribution import EUCKRDistributionAnalysis
31
 
from mbcssm import EUCKRSMModel
32
 
 
33
 
class EUCKRProber(MultiByteCharSetProber):
34
 
    def __init__(self):
35
 
        MultiByteCharSetProber.__init__(self)
36
 
        self._mCodingSM = CodingStateMachine(EUCKRSMModel)
37
 
        self._mDistributionAnalyzer = EUCKRDistributionAnalysis()
38
 
        self.reset()
39
 
 
40
 
    def get_charset_name(self):
41
 
        return "EUC-KR"