diff -Nru pychm-0.8.4/ChangeLog pychm-0.8.4.1/ChangeLog --- pychm-0.8.4/ChangeLog 2006-11-11 06:42:21.000000000 +0000 +++ pychm-0.8.4.1/ChangeLog 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -2006-11-11 Rubens Ramos - - * README, freshmeat.txt: Updating docs for release. - -2006-06-18 Rubens Ramos - - * chm/chm.py: Search is not case sensitive anymore (Glenn Washburn) - -2006-04-08 Rubens Ramos - - * chm/chm.py: I think I finally fixed the code that checks #WINDOWS - #STRINGS to obtain the index/topics/default page when these things - do not exist in the #SYSTEM file. Reported by can3p (#1464957). - -2006-01-28 Rubens Ramos - - * Fixed incorrect entries in locale table for Russian locale. - (from 'koi8' to 'cp1251') - -2005-09-19 Rubens Ramos - - * chm/__init__py: Updated version number (forgot to do it last release) - - * chm/chm.py: Bug reported by Fredrik de Vibe (#1292939) - - cannot override default params to chm.chm.RetrieveObject(). - -2004-11-27 Rubens Ramos - - * chm/chm.py: Bug reported by Torsten Marek : - When binary index is used for index/topics files, we were not - detecting the index file. My fix is actually a nasty hack. - It will need to be fixed someday - Bug #1074101. - -2004-10-08 Rubens Ramos - - * Bug #1039336: Chinese characters can't be displayed correctly - With support from Carlos Liu, enhanced support to identify - character set encoding. - -2004-04-03 Rubens Ramos - - * chm.py: removed dependency on re. - -2004-03-15 Rubens Ramos - - * setup.cfg: Updated build dependencies - -2004-02-01 Rubens Ramos - - * chm/chm.py: Added GetLCID and the codepage conversion table. - -2004-01-31 Rubens Ramos - - * chm/extra.c: Added get_lcid(), to read the locale ID from the - CHM archives. - -2004-01-15 Rubens Ramos - - * chm/chm.py: Added GetEncoding, so that now gnochm can use the - Python codecs to convert the html files from the chm archive. - -2004-01-10 Rubens Ramos - - * chm/chm.py: Added IndexSearch - - * setup.py: Adding chm.extra - - * chm/extra.c, chm/__init__py: Adding support for text search. - - * ChangeLog, setup.cfg: Created a change log :) - - diff -Nru pychm-0.8.4/chm/chm.py pychm-0.8.4.1/chm/chm.py --- pychm-0.8.4/chm/chm.py 2006-08-07 12:31:51.000000000 +0000 +++ pychm-0.8.4.1/chm/chm.py 2014-08-03 06:45:06.000000000 +0000 @@ -1,24 +1,22 @@ -## Copyright (C) 2003-2006 Rubens Ramos - -## Based on code by: -## Copyright (C) 2003 Razvan Cojocaru - -## pychm is free software; you can redistribute it and/or -## modify it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2 of the -## License, or (at your option) any later version. - -## This program 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 -## General Public License for more details. - -## You should have received a copy of the GNU General Public -## License along with this program; see the file COPYING. If not, -## write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -## Boston, MA 02111-1307, USA - -## $Id: chm.py,v 1.12 2006/08/07 12:31:51 rubensr Exp $ +# Copyright (C) 2003-2006 Rubens Ramos +# +# Based on code by: +# Copyright (C) 2003 Razvan Cojocaru +# +# pychm is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; see the file COPYING. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA ''' chm - A high-level front end for the chmlib python module. @@ -27,7 +25,7 @@ included in chmlib. It encapsulates functions in the CHMFile class, and provides some additional features, such as the ability to obtain the contents tree of a CHM archive. - + ''' import chmlib @@ -37,157 +35,158 @@ import os.path import sys -charset_table = { - 0 : 'iso8859_1', # ANSI_CHARSET - 238 : 'iso8859_2', # EASTEUROPE_CHARSET - 178 : 'iso8859_6', # ARABIC_CHARSET - 161 : 'iso8859_7', # GREEK_CHARSET - 177 : 'iso8859_8', # HEBREW_CHARSET - 162 : 'iso8859_9', # TURKISH_CHARSET - 222 : 'iso8859_11', # THAI_CHARSET - hmm not in python 2.2... - 186 : 'iso8859_13', # BALTIC_CHARSET - 204 : 'cp1251', # RUSSIAN_CHARSET - 255 : 'cp437', # OEM_CHARSET - 128 : 'cp932', # SHIFTJIS_CHARSET - 134 : 'cp936', # GB2312_CHARSET - 129 : 'cp949', # HANGUL_CHARSET - 136 : 'cp950', # CHINESEBIG5_CHARSET - 1 : None, # DEFAULT_CHARSET - 2 : None, # SYMBOL_CHARSET - 130 : None, # JOHAB_CHARSET - 163 : None, # VIETNAMESE_CHARSET - 77 : None, # MAC_CHARSET +charset_table = { + 0: 'iso8859_1', # ANSI_CHARSET + 238: 'iso8859_2', # EASTEUROPE_CHARSET + 178: 'iso8859_6', # ARABIC_CHARSET + 161: 'iso8859_7', # GREEK_CHARSET + 177: 'iso8859_8', # HEBREW_CHARSET + 162: 'iso8859_9', # TURKISH_CHARSET + 222: 'iso8859_11', # THAI_CHARSET - hmm not in python 2.2... + 186: 'iso8859_13', # BALTIC_CHARSET + 204: 'cp1251', # RUSSIAN_CHARSET + 255: 'cp437', # OEM_CHARSET + 128: 'cp932', # SHIFTJIS_CHARSET + 134: 'cp936', # GB2312_CHARSET + 129: 'cp949', # HANGUL_CHARSET + 136: 'cp950', # CHINESEBIG5_CHARSET + 1: None, # DEFAULT_CHARSET + 2: None, # SYMBOL_CHARSET + 130: None, # JOHAB_CHARSET + 163: None, # VIETNAMESE_CHARSET + 77: None, # MAC_CHARSET } locale_table = { - 0x0436 : ('iso8859_1', "Afrikaans", "Western Europe & US"), - 0x041c : ('iso8859_2', "Albanian", "Central Europe"), - 0x0401 : ('iso8859_6', "Arabic_Saudi_Arabia", "Arabic"), - 0x0801 : ('iso8859_6', "Arabic_Iraq", "Arabic"), - 0x0c01 : ('iso8859_6', "Arabic_Egypt", "Arabic"), - 0x1001 : ('iso8859_6', "Arabic_Libya", "Arabic"), - 0x1401 : ('iso8859_6', "Arabic_Algeria", "Arabic"), - 0x1801 : ('iso8859_6', "Arabic_Morocco", "Arabic"), - 0x1c01 : ('iso8859_6', "Arabic_Tunisia", "Arabic"), - 0x2001 : ('iso8859_6', "Arabic_Oman", "Arabic"), - 0x2401 : ('iso8859_6', "Arabic_Yemen", "Arabic"), - 0x2801 : ('iso8859_6', "Arabic_Syria", "Arabic"), - 0x2c01 : ('iso8859_6', "Arabic_Jordan", "Arabic"), - 0x3001 : ('iso8859_6', "Arabic_Lebanon", "Arabic"), - 0x3401 : ('iso8859_6', "Arabic_Kuwait", "Arabic"), - 0x3801 : ('iso8859_6', "Arabic_UAE", "Arabic"), - 0x3c01 : ('iso8859_6', "Arabic_Bahrain", "Arabic"), - 0x4001 : ('iso8859_6', "Arabic_Qatar", "Arabic"), - 0x042b : (None, "Armenian","Armenian"), - 0x042c : ('iso8859_9', "Azeri_Latin", "Turkish"), - 0x082c : ('cp1251', "Azeri_Cyrillic", "Cyrillic"), - 0x042d : ('iso8859_1', "Basque", "Western Europe & US"), - 0x0423 : ('cp1251', "Belarusian", "Cyrillic"), - 0x0402 : ('cp1251', "Bulgarian", "Cyrillic"), - 0x0403 : ('iso8859_1', "Catalan", "Western Europe & US"), - 0x0404 : ('cp950', "Chinese_Taiwan", "Traditional Chinese"), - 0x0804 : ('cp936', "Chinese_PRC", "Simplified Chinese"), - 0x0c04 : ('cp950', "Chinese_Hong_Kong", "Traditional Chinese"), - 0x1004 : ('cp936', "Chinese_Singapore", "Simplified Chinese"), - 0x1404 : ('cp950', "Chinese_Macau", "Traditional Chinese"), - 0x041a : ('iso8859_2', "Croatian", "Central Europe"), - 0x0405 : ('iso8859_2', "Czech", "Central Europe"), - 0x0406 : ('iso8859_1', "Danish", "Western Europe & US"), - 0x0413 : ('iso8859_1', "Dutch_Standard", "Western Europe & US"), - 0x0813 : ('iso8859_1', "Dutch_Belgian", "Western Europe & US"), - 0x0409 : ('iso8859_1', "English_United_States", "Western Europe & US"), - 0x0809 : ('iso8859_1', "English_United_Kingdom", "Western Europe & US"), - 0x0c09 : ('iso8859_1', "English_Australian", "Western Europe & US"), - 0x1009 : ('iso8859_1', "English_Canadian", "Western Europe & US"), - 0x1409 : ('iso8859_1', "English_New_Zealand", "Western Europe & US"), - 0x1809 : ('iso8859_1', "English_Irish", "Western Europe & US"), - 0x1c09 : ('iso8859_1', "English_South_Africa", "Western Europe & US"), - 0x2009 : ('iso8859_1', "English_Jamaica", "Western Europe & US"), - 0x2409 : ('iso8859_1', "English_Caribbean", "Western Europe & US"), - 0x2809 : ('iso8859_1', "English_Belize", "Western Europe & US"), - 0x2c09 : ('iso8859_1', "English_Trinidad", "Western Europe & US"), - 0x3009 : ('iso8859_1', "English_Zimbabwe", "Western Europe & US"), - 0x3409 : ('iso8859_1', "English_Philippines", "Western Europe & US"), - 0x0425 : ('iso8859_13',"Estonian", "Baltic",), - 0x0438 : ('iso8859_1', "Faeroese", "Western Europe & US"), - 0x0429 : ('iso8859_6', "Farsi", "Arabic"), - 0x040b : ('iso8859_1', "Finnish", "Western Europe & US"), - 0x040c : ('iso8859_1', "French_Standard", "Western Europe & US"), - 0x080c : ('iso8859_1', "French_Belgian", "Western Europe & US"), - 0x0c0c : ('iso8859_1', "French_Canadian", "Western Europe & US"), - 0x100c : ('iso8859_1', "French_Swiss", "Western Europe & US"), - 0x140c : ('iso8859_1', "French_Luxembourg", "Western Europe & US"), - 0x180c : ('iso8859_1', "French_Monaco", "Western Europe & US"), - 0x0437 : (None, "Georgian", "Georgian"), - 0x0407 : ('iso8859_1', "German_Standard", "Western Europe & US"), - 0x0807 : ('iso8859_1', "German_Swiss", "Western Europe & US"), - 0x0c07 : ('iso8859_1', "German_Austrian", "Western Europe & US"), - 0x1007 : ('iso8859_1', "German_Luxembourg", "Western Europe & US"), - 0x1407 : ('iso8859_1', "German_Liechtenstein", "Western Europe & US"), - 0x0408 : ('iso8859_7', "Greek", "Greek"), - 0x040d : ('iso8859_8', "Hebrew", "Hebrew"), - 0x0439 : (None, "Hindi", "Indic"), - 0x040e : ('iso8859_2', "Hungarian", "Central Europe"), - 0x040f : ('iso8859_1', "Icelandic", "Western Europe & US"), - 0x0421 : ('iso8859_1', "Indonesian", "Western Europe & US"), - 0x0410 : ('iso8859_1', "Italian_Standard", "Western Europe & US"), - 0x0810 : ('iso8859_1', "Italian_Swiss", "Western Europe & US"), - 0x0411 : ('cp932', "Japanese", "Japanese"), - 0x043f : ('cp1251', "Kazakh", "Cyrillic"), - 0x0457 : (None, "Konkani", "Indic"), - 0x0412 : ('cp949', "Korean", "Korean"), - 0x0426 : ('iso8859_13',"Latvian", "Baltic",), - 0x0427 : ('iso8859_13',"Lithuanian", "Baltic",), - 0x042f : ('cp1251', "Macedonian", "Cyrillic"), - 0x043e : ('iso8859_1', "Malay_Malaysia", "Western Europe & US"), - 0x083e : ('iso8859_1', "Malay_Brunei_Darussalam", "Western Europe & US"), - 0x044e : (None, "Marathi", "Indic"), - 0x0414 : ('iso8859_1', "Norwegian_Bokmal", "Western Europe & US"), - 0x0814 : ('iso8859_1', "Norwegian_Nynorsk", "Western Europe & US"), - 0x0415 : ('iso8859_2', "Polish", "Central Europe"), - 0x0416 : ('iso8859_1', "Portuguese_Brazilian", "Western Europe & US"), - 0x0816 : ('iso8859_1', "Portuguese_Standard", "Western Europe & US"), - 0x0418 : ('iso8859_2', "Romanian", "Central Europe"), - 0x0419 : ('cp1251', "Russian", "Cyrillic"), - 0x044f : (None, "Sanskrit", "Indic"), - 0x081a : ('iso8859_2', "Serbian_Latin", "Central Europe"), - 0x0c1a : ('cp1251', "Serbian_Cyrillic", "Cyrillic"), - 0x041b : ('iso8859_2', "Slovak", "Central Europe"), - 0x0424 : ('iso8859_2', "Slovenian", "Central Europe"), - 0x040a : ('iso8859_1', "Spanish_Trad_Sort", "Western Europe & US"), - 0x080a : ('iso8859_1', "Spanish_Mexican", "Western Europe & US"), - 0x0c0a : ('iso8859_1', "Spanish_Modern_Sort", "Western Europe & US"), - 0x100a : ('iso8859_1', "Spanish_Guatemala", "Western Europe & US"), - 0x140a : ('iso8859_1', "Spanish_Costa_Rica", "Western Europe & US"), - 0x180a : ('iso8859_1', "Spanish_Panama", "Western Europe & US"), - 0x1c0a : ('iso8859_1', "Spanish_Dominican_Repub", "Western Europe & US"), - 0x200a : ('iso8859_1', "Spanish_Venezuela", "Western Europe & US"), - 0x240a : ('iso8859_1', "Spanish_Colombia", "Western Europe & US"), - 0x280a : ('iso8859_1', "Spanish_Peru", "Western Europe & US"), - 0x2c0a : ('iso8859_1', "Spanish_Argentina", "Western Europe & US"), - 0x300a : ('iso8859_1', "Spanish_Ecuador", "Western Europe & US"), - 0x340a : ('iso8859_1', "Spanish_Chile", "Western Europe & US"), - 0x380a : ('iso8859_1', "Spanish_Uruguay", "Western Europe & US"), - 0x3c0a : ('iso8859_1', "Spanish_Paraguay", "Western Europe & US"), - 0x400a : ('iso8859_1', "Spanish_Bolivia", "Western Europe & US"), - 0x440a : ('iso8859_1', "Spanish_El_Salvador", "Western Europe & US"), - 0x480a : ('iso8859_1', "Spanish_Honduras", "Western Europe & US"), - 0x4c0a : ('iso8859_1', "Spanish_Nicaragua", "Western Europe & US"), - 0x500a : ('iso8859_1', "Spanish_Puerto_Rico", "Western Europe & US"), - 0x0441 : ('iso8859_1', "Swahili", "Western Europe & US"), - 0x041d : ('iso8859_1', "Swedish", "Western Europe & US"), - 0x081d : ('iso8859_1', "Swedish_Finland", "Western Europe & US"), - 0x0449 : (None, "Tamil", "Indic"), - 0x0444 : ('cp1251', "Tatar", "Cyrillic"), - 0x041e : ('iso8859_11',"Thai", "Thai"), - 0x041f : ('iso8859_9', "Turkish", "Turkish"), - 0x0422 : ('cp1251', "Ukrainian", "Cyrillic"), - 0x0420 : ('iso8859_6', "Urdu", "Arabic"), - 0x0443 : ('iso8859_9', "Uzbek_Latin", "Turkish"), - 0x0843 : ('cp1251', "Uzbek_Cyrillic", "Cyrillic"), - 0x042a : (None, "Vietnamese", "Vietnamese") + 0x0436: ('iso8859_1', "Afrikaans", "Western Europe & US"), + 0x041c: ('iso8859_2', "Albanian", "Central Europe"), + 0x0401: ('iso8859_6', "Arabic_Saudi_Arabia", "Arabic"), + 0x0801: ('iso8859_6', "Arabic_Iraq", "Arabic"), + 0x0c01: ('iso8859_6', "Arabic_Egypt", "Arabic"), + 0x1001: ('iso8859_6', "Arabic_Libya", "Arabic"), + 0x1401: ('iso8859_6', "Arabic_Algeria", "Arabic"), + 0x1801: ('iso8859_6', "Arabic_Morocco", "Arabic"), + 0x1c01: ('iso8859_6', "Arabic_Tunisia", "Arabic"), + 0x2001: ('iso8859_6', "Arabic_Oman", "Arabic"), + 0x2401: ('iso8859_6', "Arabic_Yemen", "Arabic"), + 0x2801: ('iso8859_6', "Arabic_Syria", "Arabic"), + 0x2c01: ('iso8859_6', "Arabic_Jordan", "Arabic"), + 0x3001: ('iso8859_6', "Arabic_Lebanon", "Arabic"), + 0x3401: ('iso8859_6', "Arabic_Kuwait", "Arabic"), + 0x3801: ('iso8859_6', "Arabic_UAE", "Arabic"), + 0x3c01: ('iso8859_6', "Arabic_Bahrain", "Arabic"), + 0x4001: ('iso8859_6', "Arabic_Qatar", "Arabic"), + 0x042b: (None, "Armenian", "Armenian"), + 0x042c: ('iso8859_9', "Azeri_Latin", "Turkish"), + 0x082c: ('cp1251', "Azeri_Cyrillic", "Cyrillic"), + 0x042d: ('iso8859_1', "Basque", "Western Europe & US"), + 0x0423: ('cp1251', "Belarusian", "Cyrillic"), + 0x0402: ('cp1251', "Bulgarian", "Cyrillic"), + 0x0403: ('iso8859_1', "Catalan", "Western Europe & US"), + 0x0404: ('cp950', "Chinese_Taiwan", "Traditional Chinese"), + 0x0804: ('cp936', "Chinese_PRC", "Simplified Chinese"), + 0x0c04: ('cp950', "Chinese_Hong_Kong", "Traditional Chinese"), + 0x1004: ('cp936', "Chinese_Singapore", "Simplified Chinese"), + 0x1404: ('cp950', "Chinese_Macau", "Traditional Chinese"), + 0x041a: ('iso8859_2', "Croatian", "Central Europe"), + 0x0405: ('iso8859_2', "Czech", "Central Europe"), + 0x0406: ('iso8859_1', "Danish", "Western Europe & US"), + 0x0413: ('iso8859_1', "Dutch_Standard", "Western Europe & US"), + 0x0813: ('iso8859_1', "Dutch_Belgian", "Western Europe & US"), + 0x0409: ('iso8859_1', "English_United_States", "Western Europe & US"), + 0x0809: ('iso8859_1', "English_United_Kingdom", "Western Europe & US"), + 0x0c09: ('iso8859_1', "English_Australian", "Western Europe & US"), + 0x1009: ('iso8859_1', "English_Canadian", "Western Europe & US"), + 0x1409: ('iso8859_1', "English_New_Zealand", "Western Europe & US"), + 0x1809: ('iso8859_1', "English_Irish", "Western Europe & US"), + 0x1c09: ('iso8859_1', "English_South_Africa", "Western Europe & US"), + 0x2009: ('iso8859_1', "English_Jamaica", "Western Europe & US"), + 0x2409: ('iso8859_1', "English_Caribbean", "Western Europe & US"), + 0x2809: ('iso8859_1', "English_Belize", "Western Europe & US"), + 0x2c09: ('iso8859_1', "English_Trinidad", "Western Europe & US"), + 0x3009: ('iso8859_1', "English_Zimbabwe", "Western Europe & US"), + 0x3409: ('iso8859_1', "English_Philippines", "Western Europe & US"), + 0x0425: ('iso8859_13', "Estonian", "Baltic",), + 0x0438: ('iso8859_1', "Faeroese", "Western Europe & US"), + 0x0429: ('iso8859_6', "Farsi", "Arabic"), + 0x040b: ('iso8859_1', "Finnish", "Western Europe & US"), + 0x040c: ('iso8859_1', "French_Standard", "Western Europe & US"), + 0x080c: ('iso8859_1', "French_Belgian", "Western Europe & US"), + 0x0c0c: ('iso8859_1', "French_Canadian", "Western Europe & US"), + 0x100c: ('iso8859_1', "French_Swiss", "Western Europe & US"), + 0x140c: ('iso8859_1', "French_Luxembourg", "Western Europe & US"), + 0x180c: ('iso8859_1', "French_Monaco", "Western Europe & US"), + 0x0437: (None, "Georgian", "Georgian"), + 0x0407: ('iso8859_1', "German_Standard", "Western Europe & US"), + 0x0807: ('iso8859_1', "German_Swiss", "Western Europe & US"), + 0x0c07: ('iso8859_1', "German_Austrian", "Western Europe & US"), + 0x1007: ('iso8859_1', "German_Luxembourg", "Western Europe & US"), + 0x1407: ('iso8859_1', "German_Liechtenstein", "Western Europe & US"), + 0x0408: ('iso8859_7', "Greek", "Greek"), + 0x040d: ('iso8859_8', "Hebrew", "Hebrew"), + 0x0439: (None, "Hindi", "Indic"), + 0x040e: ('iso8859_2', "Hungarian", "Central Europe"), + 0x040f: ('iso8859_1', "Icelandic", "Western Europe & US"), + 0x0421: ('iso8859_1', "Indonesian", "Western Europe & US"), + 0x0410: ('iso8859_1', "Italian_Standard", "Western Europe & US"), + 0x0810: ('iso8859_1', "Italian_Swiss", "Western Europe & US"), + 0x0411: ('cp932', "Japanese", "Japanese"), + 0x043f: ('cp1251', "Kazakh", "Cyrillic"), + 0x0457: (None, "Konkani", "Indic"), + 0x0412: ('cp949', "Korean", "Korean"), + 0x0426: ('iso8859_13', "Latvian", "Baltic",), + 0x0427: ('iso8859_13', "Lithuanian", "Baltic",), + 0x042f: ('cp1251', "Macedonian", "Cyrillic"), + 0x043e: ('iso8859_1', "Malay_Malaysia", "Western Europe & US"), + 0x083e: ('iso8859_1', "Malay_Brunei_Darussalam", "Western Europe & US"), + 0x044e: (None, "Marathi", "Indic"), + 0x0414: ('iso8859_1', "Norwegian_Bokmal", "Western Europe & US"), + 0x0814: ('iso8859_1', "Norwegian_Nynorsk", "Western Europe & US"), + 0x0415: ('iso8859_2', "Polish", "Central Europe"), + 0x0416: ('iso8859_1', "Portuguese_Brazilian", "Western Europe & US"), + 0x0816: ('iso8859_1', "Portuguese_Standard", "Western Europe & US"), + 0x0418: ('iso8859_2', "Romanian", "Central Europe"), + 0x0419: ('cp1251', "Russian", "Cyrillic"), + 0x044f: (None, "Sanskrit", "Indic"), + 0x081a: ('iso8859_2', "Serbian_Latin", "Central Europe"), + 0x0c1a: ('cp1251', "Serbian_Cyrillic", "Cyrillic"), + 0x041b: ('iso8859_2', "Slovak", "Central Europe"), + 0x0424: ('iso8859_2', "Slovenian", "Central Europe"), + 0x040a: ('iso8859_1', "Spanish_Trad_Sort", "Western Europe & US"), + 0x080a: ('iso8859_1', "Spanish_Mexican", "Western Europe & US"), + 0x0c0a: ('iso8859_1', "Spanish_Modern_Sort", "Western Europe & US"), + 0x100a: ('iso8859_1', "Spanish_Guatemala", "Western Europe & US"), + 0x140a: ('iso8859_1', "Spanish_Costa_Rica", "Western Europe & US"), + 0x180a: ('iso8859_1', "Spanish_Panama", "Western Europe & US"), + 0x1c0a: ('iso8859_1', "Spanish_Dominican_Repub", "Western Europe & US"), + 0x200a: ('iso8859_1', "Spanish_Venezuela", "Western Europe & US"), + 0x240a: ('iso8859_1', "Spanish_Colombia", "Western Europe & US"), + 0x280a: ('iso8859_1', "Spanish_Peru", "Western Europe & US"), + 0x2c0a: ('iso8859_1', "Spanish_Argentina", "Western Europe & US"), + 0x300a: ('iso8859_1', "Spanish_Ecuador", "Western Europe & US"), + 0x340a: ('iso8859_1', "Spanish_Chile", "Western Europe & US"), + 0x380a: ('iso8859_1', "Spanish_Uruguay", "Western Europe & US"), + 0x3c0a: ('iso8859_1', "Spanish_Paraguay", "Western Europe & US"), + 0x400a: ('iso8859_1', "Spanish_Bolivia", "Western Europe & US"), + 0x440a: ('iso8859_1', "Spanish_El_Salvador", "Western Europe & US"), + 0x480a: ('iso8859_1', "Spanish_Honduras", "Western Europe & US"), + 0x4c0a: ('iso8859_1', "Spanish_Nicaragua", "Western Europe & US"), + 0x500a: ('iso8859_1', "Spanish_Puerto_Rico", "Western Europe & US"), + 0x0441: ('iso8859_1', "Swahili", "Western Europe & US"), + 0x041d: ('iso8859_1', "Swedish", "Western Europe & US"), + 0x081d: ('iso8859_1', "Swedish_Finland", "Western Europe & US"), + 0x0449: (None, "Tamil", "Indic"), + 0x0444: ('cp1251', "Tatar", "Cyrillic"), + 0x041e: ('iso8859_11', "Thai", "Thai"), + 0x041f: ('iso8859_9', "Turkish", "Turkish"), + 0x0422: ('cp1251', "Ukrainian", "Cyrillic"), + 0x0420: ('iso8859_6', "Urdu", "Arabic"), + 0x0443: ('iso8859_9', "Uzbek_Latin", "Turkish"), + 0x0843: ('cp1251', "Uzbek_Cyrillic", "Cyrillic"), + 0x042a: (None, "Vietnamese", "Vietnamese") } + class CHMFile: "A class to manage access to CHM files." filename = "" @@ -199,21 +198,21 @@ encoding = None lcid = None binaryindex = None - + def __init__(self): self.searchable = 0 - + def LoadCHM(self, archiveName): '''Loads a CHM archive. This function will also call GetArchiveInfo to obtain information such as the index file name and the topics file. It returns 1 on success, and 0 if it fails. ''' - if (self.filename != None): + if self.filename is not None: self.CloseCHM() self.file = chmlib.chm_open(archiveName) - if (self.file == None): + if self.file is None: return 0 self.filename = archiveName @@ -226,7 +225,7 @@ This function will close the CHM file, if it is open. All variables are also reset. ''' - if (self.filename != None): + if self.filename is not None: chmlib.chm_close(self.file) self.file = None self.filename = '' @@ -243,14 +242,14 @@ from LoadCHM. ''' - self.searchable = extra.is_searchable (self.file) + self.searchable = extra.is_searchable(self.file) self.lcid = None - + result, ui = chmlib.chm_resolve_object(self.file, '/#SYSTEM') if (result != chmlib.CHM_RESOLVE_SUCCESS): sys.stderr.write('GetArchiveInfo: #SYSTEM does not exist\n') return 0 - + size, text = chmlib.chm_retrieve_object(self.file, ui, 4l, ui.length) if (size == 0): sys.stderr.write('GetArchiveInfo: file size = 0\n') @@ -297,11 +296,9 @@ tmp2 = '/' + tmp + '.hhk' res1, ui1 = chmlib.chm_resolve_object(self.file, tmp1) res2, ui2 = chmlib.chm_resolve_object(self.file, tmp2) - if (not self.topics) and \ - (res1 == chmlib.CHM_RESOLVE_SUCCESS): + if not self.topics and res1 == chmlib.CHM_RESOLVE_SUCCESS: self.topics = '/' + tmp + '.hhc' - if (not self.index) and \ - (res2 == chmlib.CHM_RESOLVE_SUCCESS): + if not self.index and res2 == chmlib.CHM_RESOLVE_SUCCESS: self.index = '/' + tmp + '.hhk' elif (cursor == 16): index += 2 @@ -315,9 +312,9 @@ index += cursor self.GetWindowsInfo() - + if not self.lcid: - self.lcid = extra.get_lcid (self.file) + self.lcid = extra.get_lcid(self.file) return 1 @@ -326,7 +323,7 @@ This auxiliary function reads and returns the topics tree file contents for the CHM archive. ''' - if (self.topics == None): + if self.topics is None: return None if self.topics: @@ -345,7 +342,7 @@ This auxiliary function reads and returns the index tree file contents for the CHM archive. ''' - if (self.index == None): + if self.index is None: return None if self.index: @@ -372,7 +369,7 @@ else: return (1, None) - def RetrieveObject(self, ui, start = -1, length = -1): + def RetrieveObject(self, ui, start=-1, length=-1): '''Retrieves the contents of a document. This function takes a UnitInfo and two optional arguments, the first being the start address and the second is the length. These define @@ -401,8 +398,8 @@ indicating if the search results were partial, and the second item being a dictionary containing the results.''' if text and text != '' and self.file: - return extra.search (self.file, text, wholewords, - titleonly) + return extra.search(self.file, text, wholewords, + titleonly) else: return None @@ -436,12 +433,12 @@ '''Internal method. Reads a double word (4 bytes) from a buffer. ''' - result = buff[idx] + (buff[idx+1]<<8) + (buff[idx+2]<<16) + \ - (buff[idx+3]<<24) + result = buff[idx] + (buff[idx+1] << 8) + (buff[idx+2] << 16) + \ + (buff[idx+3] << 24) if result == 0xFFFFFFFF: result = 0 - + return result def GetString(self, text, idx): @@ -451,7 +448,7 @@ next = string.find(text, '\x00', idx) chunk = text[idx:next] return chunk - + def GetWindowsInfo(self): '''Gets information from the #WINDOWS file. Checks the #WINDOWS file to see if it has any info that was @@ -471,7 +468,7 @@ if num_entries < 1: return -3 - + size, text = chmlib.chm_retrieve_object(self.file, ui, 8l, entry_size) if (size < entry_size): return -4 @@ -480,11 +477,11 @@ toc_index = self.GetDWORD(buff, 0x60) idx_index = self.GetDWORD(buff, 0x64) dft_index = self.GetDWORD(buff, 0x68) - + result, ui = chmlib.chm_resolve_object(self.file, '/#STRINGS') if (result != chmlib.CHM_RESOLVE_SUCCESS): return -5 - + size, text = chmlib.chm_retrieve_object(self.file, ui, 0l, ui.length) if (size == 0): return -6 @@ -493,7 +490,7 @@ self.topics = self.GetString(text, toc_index) if not self.topics.startswith("/"): self.topics = "/" + self.topics - + if (not self.index): self.index = self.GetString(text, idx_index) if not self.index.startswith("/"): diff -Nru pychm-0.8.4/chm/extra.c pychm-0.8.4.1/chm/extra.c --- pychm-0.8.4/chm/extra.c 2006-06-10 02:17:45.000000000 +0000 +++ pychm-0.8.4.1/chm/extra.c 2014-08-02 14:53:48.000000000 +0000 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, + * Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * Author: Rubens Ramos @@ -70,13 +70,13 @@ #define FREE(x) free (x); x = NULL -inline uint16_t +static uint16_t get_uint16 (uint8_t* b) { return b[0] | b[1]<<8; } -inline uint32_t +static uint32_t get_uint32 (uint8_t* b) { return b[0] | b[1]<<8 | @@ -84,7 +84,7 @@ b[3]<<24; } -inline uint64_t +static uint64_t get_uint64 (uint8_t* b) { return b[0] | b[1]<<8 | @@ -96,20 +96,20 @@ (uint64_t) b[7]<<56; } -inline uint64_t +static uint64_t be_encint (unsigned char *buffer, size_t *length) { uint64_t result = 0; int shift=0; *length = 0; - + do { result |= ((*buffer) & 0x7f) << shift; shift += 7; *length = *length + 1; - + } while (*(buffer++) & 0x80); - + return result; } @@ -117,11 +117,11 @@ Finds the first unset bit in memory. Returns the number of set bits found. Returns -1 if the buffer runs out before we find an unset bit. */ -inline int +static int ffus (unsigned char* byte, int* bit, size_t *length) { int bits = 0; *length = 0; - + while(*byte & (1 << *bit)){ if(*bit) --(*bit); @@ -132,19 +132,19 @@ } ++bits; } - + if(*bit) --(*bit); else { ++(*length); *bit = 7; } - + return bits; } -inline uint64_t +static uint64_t sr_int(unsigned char* byte, int* bit, unsigned char s, unsigned char r, size_t *length) { @@ -154,21 +154,21 @@ size_t fflen; *length = 0; - + if(!bit || *bit > 7 || s != 2) return ~(uint64_t)0; ret = 0; - + count = ffus(byte, bit, &fflen); *length += fflen; byte += *length; - + n_bits = n = r + (count ? count-1 : 0) ; - + while (n > 0) { num_bits = n > *bit ? *bit : n-1; base = n > *bit ? 0 : *bit - (n-1); - + switch (num_bits){ case 0: mask = 1; @@ -198,11 +198,11 @@ mask = 0xff; break; } - + mask <<= base; ret = (ret << (num_bits+1)) | (uint64_t)((*byte & mask) >> base); - + if( n > *bit ){ ++byte; ++(*length); @@ -213,15 +213,15 @@ n = 0; } } - + if(count) ret |= (uint64_t)1 << n_bits; - + return ret; } - -inline uint32_t + +static uint32_t get_leaf_node_offset(struct chmFile *chmfile, const char *text, uint32_t initial_offset, @@ -240,31 +240,31 @@ if (NULL == buffer) return 0; - + while (--tree_depth) { if (initial_offset == test_offset) { FREE(buffer); return 0; } - + test_offset = initial_offset; - if (chm_retrieve_object (chmfile, ui, buffer, + if (chm_retrieve_object (chmfile, ui, buffer, initial_offset, buff_size) == 0) { FREE(buffer); return 0; } - + free_space = get_uint16 (buffer); - + while (i < buff_size - free_space) { word_len = *(buffer + i); pos = *(buffer + i + 1); - + wrd_buf = malloc (word_len); memcpy (wrd_buf, buffer + i + 2, word_len - 1); wrd_buf[word_len - 1] = 0; - + if (pos == 0) { FREE (word); word = (char *) strdup (wrd_buf); @@ -274,17 +274,17 @@ } FREE(wrd_buf); - + if (strcasecmp (text, word) <= 0) { initial_offset = get_uint32 (buffer + i + word_len + 1); break; } - - i += word_len + sizeof (unsigned char) + sizeof(uint32_t) + + + i += word_len + sizeof (unsigned char) + sizeof(uint32_t) + sizeof(uint16_t); } } - + if(initial_offset == test_offset) initial_offset = 0; @@ -294,7 +294,7 @@ return initial_offset; } -inline int +static int pychm_process_wlc (struct chmFile *chmfile, uint64_t wlc_count, uint64_t wlc_size, uint32_t wlc_offset, unsigned char ds, @@ -319,14 +319,14 @@ char *url = NULL; char *topic = NULL; - if (chm_retrieve_object(chmfile, uimain, buffer, + if (chm_retrieve_object(chmfile, uimain, buffer, wlc_offset, wlc_size) == 0) { FREE(buffer); return false; } for (i = 0; i < wlc_count; ++i) { - + if(wlc_bit != 7) { ++off; wlc_bit = 7; @@ -335,7 +335,7 @@ index += sr_int(buffer + off, &wlc_bit, ds, dr, &length); off += length; - if(chm_retrieve_object(chmfile, topics, entry, + if(chm_retrieve_object(chmfile, topics, entry, index * 16, TOPICS_ENTRY_LEN) == 0) { FREE(topic); FREE(url); @@ -347,34 +347,34 @@ stroff = get_uint32 (entry + 4); FREE (topic); - if (chm_retrieve_object (chmfile, uistrings, combuf, + if (chm_retrieve_object (chmfile, uistrings, combuf, stroff, COMMON_BUF_LEN - 1) == 0) { topic = strdup ("Untitled in index"); } else { combuf[COMMON_BUF_LEN - 1] = 0; - + topic = strdup (combuf); } - + urloff = get_uint32 (entry + 8); - if(chm_retrieve_object (chmfile, uitbl, combuf, + if(chm_retrieve_object (chmfile, uitbl, combuf, urloff, 12) == 0) { FREE(buffer); return false; } urloff = get_uint32 (combuf + 8); - - if (chm_retrieve_object (chmfile, urlstr, combuf, + + if (chm_retrieve_object (chmfile, urlstr, combuf, urloff + 8, COMMON_BUF_LEN - 1) == 0) { FREE(topic); FREE(url); FREE(buffer); return false; } - + combuf[COMMON_BUF_LEN - 1] = 0; FREE (url); @@ -382,16 +382,16 @@ if (url && topic) { #ifdef __PYTHON__ - PyDict_SetItemString (dict, topic, + PyDict_SetItemString (dict, topic, PyString_FromString (url)); #else printf ("%s ==> %s\n", url, topic); #endif } - + count = sr_int (buffer + off, &wlc_bit, cs, cr, &length); off += length; - + for (j = 0; j < count; ++j) { sr_int (buffer + off, &wlc_bit, ls, lr, &length); off += length; @@ -405,9 +405,9 @@ return true; } -int +static int chm_search (struct chmFile *chmfile, - const char *text, int whole_words, + const char *text, int whole_words, int titles_only, PyObject *dict) { unsigned char header[FTS_HEADER_LEN]; @@ -437,7 +437,7 @@ return -1; if (chm_resolve_object (chmfile, "/$FIftiMain", &ui) != - CHM_RESOLVE_SUCCESS || + CHM_RESOLVE_SUCCESS || chm_resolve_object (chmfile, "/#TOPICS", &uitopics) != CHM_RESOLVE_SUCCESS || chm_resolve_object (chmfile, "/#STRINGS", &uistrings) != @@ -450,7 +450,7 @@ if(chm_retrieve_object(chmfile, &ui, header, 0, FTS_HEADER_LEN) == 0) return false; - + doc_index_s = header[0x1E]; doc_index_r = header[0x1F]; code_count_s = header[0x20]; @@ -467,40 +467,40 @@ tree_depth = get_uint16 (header + 0x18); i = sizeof(uint16_t); - + buffer = malloc (node_len); - + node_offset = get_leaf_node_offset (chmfile, text, node_offset, node_len, tree_depth, &ui); - - if (!node_offset) { + + if (!node_offset) { FREE(buffer); return false; } - + do { - - if (chm_retrieve_object (chmfile, &ui, buffer, + + if (chm_retrieve_object (chmfile, &ui, buffer, node_offset, node_len) == 0) { FREE(word); FREE(buffer); return false; } - + free_space = get_uint16 (buffer + 6); - + i = sizeof(uint32_t) + sizeof(uint16_t) + sizeof(uint16_t); - + encsz = 0; while (i < node_len - free_space) { word_len = *(buffer + i); pos = *(buffer + i + 1); - + wrd_buf = malloc (word_len); memcpy (wrd_buf, buffer + i + 2, word_len - 1); wrd_buf[word_len - 1] = 0; - + if (pos == 0) { FREE(word); word = (char *) strdup (wrd_buf); @@ -510,29 +510,29 @@ } FREE(wrd_buf); - + i += 2 + word_len; title = *(buffer + i - 1); wlc_count = be_encint (buffer + i, &encsz); i += encsz; - + wlc_offset = get_uint32 (buffer + i); i += sizeof(uint32_t) + sizeof(uint16_t); wlc_size = be_encint (buffer + i, &encsz); i += encsz; - + node_offset = get_uint32 (buffer); if (!title && titles_only) continue; - + if (whole_words && !strcasecmp(text, word)) { - partial = pychm_process_wlc (chmfile, wlc_count, wlc_size, - wlc_offset, doc_index_s, - doc_index_r,code_count_s, - code_count_r, loc_codes_s, + partial = pychm_process_wlc (chmfile, wlc_count, wlc_size, + wlc_offset, doc_index_s, + doc_index_r,code_count_s, + code_count_r, loc_codes_s, loc_codes_r, &ui, &uiurltbl, &uistrings, &uitopics, &uiurlstr, dict); @@ -540,27 +540,27 @@ FREE(buffer); return partial; } - + if (!whole_words) { if (!strncasecmp (word, text, strlen(text))) { partial = true; - pychm_process_wlc (chmfile, wlc_count, wlc_size, - wlc_offset, doc_index_s, - doc_index_r,code_count_s, - code_count_r, loc_codes_s, + pychm_process_wlc (chmfile, wlc_count, wlc_size, + wlc_offset, doc_index_s, + doc_index_r,code_count_s, + code_count_r, loc_codes_s, loc_codes_r, &ui, &uiurltbl, &uistrings, &uitopics, &uiurlstr, dict); - + } else if (strncasecmp (text, word, strlen(text)) < -1) break; } } - } while (!whole_words && - !strncmp (word, text, strlen(text)) && + } while (!whole_words && + !strncmp (word, text, strlen(text)) && node_offset); - + FREE(word); FREE(buffer); @@ -572,7 +572,7 @@ int offset; } Langrec; -Langrec lang_files[] = { +static Langrec lang_files[] = { {"/$FIftiMain", 0x7E}, {"$WWKeywordLinks/BTree", 0x34}, {"$WWAssociativeLinks/BTree", 0x34} @@ -580,18 +580,18 @@ #define LANG_FILES_SIZE (sizeof(lang_files)/sizeof(Langrec)) -int +static int chm_get_lcid (struct chmFile *chmfile) { struct chmUnitInfo ui; uint32_t lang; int i; for (i=0; i \n"); printf ("> "); if (scanf ("%d %d %s", &whole_words, &titles_only, text)) - partial = chm_search (file, + partial = chm_search (file, text, whole_words, titles_only, NULL); - else + else break; - + printf ("Partial = %d\n", partial); } diff -Nru pychm-0.8.4/chm/__init__.py pychm-0.8.4.1/chm/__init__.py --- pychm-0.8.4/chm/__init__.py 2006-06-18 10:50:43.000000000 +0000 +++ pychm-0.8.4.1/chm/__init__.py 2014-08-03 06:45:24.000000000 +0000 @@ -1,21 +1,20 @@ -## Copyright (C) 2003-2006 Rubens Ramos - -## pychm is free software; you can redistribute it and/or -## modify it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2 of the -## License, or (at your option) any later version. - -## This program 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 -## General Public License for more details. - -## You should have received a copy of the GNU General Public -## License along with this program; see the file COPYING. If not, -## write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -## Boston, MA 02111-1307, USA - -## $Id: __init__.py,v 1.8 2006/06/18 10:50:43 rubensr Exp $ +# Copyright (C) 2003-2006 Rubens Ramos +# +# pychm is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; see the file COPYING. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA +# ''' chm - A package to manipulate CHM files @@ -29,6 +28,5 @@ access to the CHM files information. ''' __all__ = ["chm", "chmlib", "_chmlib", "extra"] -__version__ = "0.8.4" -__revision__ = "$Id: __init__.py,v 1.8 2006/06/18 10:50:43 rubensr Exp $" - +__version__ = "0.8.4.1" +__revision__ = "$Id$" diff -Nru pychm-0.8.4/chm/swig_chm.c pychm-0.8.4.1/chm/swig_chm.c --- pychm-0.8.4/chm/swig_chm.c 2004-01-09 23:36:08.000000000 +0000 +++ pychm-0.8.4.1/chm/swig_chm.c 2014-08-02 14:55:46.000000000 +0000 @@ -1,11 +1,11 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.18 - * - * This file is not intended to be easily readable and contains a number of + * + * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIGPYTHON @@ -22,7 +22,7 @@ * Author : David Beazley (beazley@cs.uchicago.edu) * * Copyright (c) 1999-2000, The University of Chicago - * + * * This file may be freely redistributed without license or fee provided * this copyright message remains intact. ************************************************************************/ @@ -66,10 +66,10 @@ typedef struct swig_type_info *(*swig_dycast_func)(void **); typedef struct swig_type_info { - const char *name; + const char *name; swig_converter_func converter; const char *str; - void *clientdata; + void *clientdata; swig_dycast_func dcast; struct swig_type_info *next; struct swig_type_info *prev; @@ -99,7 +99,7 @@ while (tc) { if (strcmp(tc->name, ti->name) == 0) { /* Already exists in the table. Just add additional types to the list */ - if (tc->clientdata) ti->clientdata = tc->clientdata; + if (tc->clientdata) ti->clientdata = tc->clientdata; head = tc; next = tc->next; goto l1; @@ -130,7 +130,7 @@ } /* Check the typename */ -SWIGRUNTIME(swig_type_info *) +SWIGRUNTIME(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *ty) { swig_type_info *s; @@ -157,16 +157,16 @@ } /* Cast a pointer up an inheritance hierarchy */ -SWIGRUNTIME(void *) -SWIG_TypeCast(swig_type_info *ty, void *ptr) +SWIGRUNTIME(void *) +SWIG_TypeCast(swig_type_info *ty, void *ptr) { if ((!ty) || (!ty->converter)) return ptr; return (*ty->converter)(ptr); } /* Dynamic pointer casting. Down an inheritance hierarchy */ -SWIGRUNTIME(swig_type_info *) -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) +SWIGRUNTIME(swig_type_info *) +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; @@ -278,7 +278,7 @@ * global variable support code. * ----------------------------------------------------------------------------- */ -typedef struct swig_globalvar { +typedef struct swig_globalvar { char *name; /* Name of global variable */ PyObject *(*get_attr)(void); /* Return the current value */ int (*set_attr)(PyObject *); /* Set the value */ @@ -336,17 +336,17 @@ } statichere PyTypeObject varlinktype = { - PyObject_HEAD_INIT(0) + PyObject_HEAD_INIT(0) 0, (char *)"swigvarlink", /* Type name */ sizeof(swig_varlinkobject), /* Basic size */ 0, /* Itemsize */ - 0, /* Deallocator */ + 0, /* Deallocator */ (printfunc) swig_varlink_print, /* Print */ (getattrfunc) swig_varlink_getattr, /* get attr */ (setattrfunc) swig_varlink_setattr, /* Set attr */ 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ + (reprfunc) swig_varlink_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_mapping*/ 0, /* tp_hash */ @@ -444,7 +444,7 @@ Py_DECREF(obj); goto type_error; } - } + } *ptr = PyCObject_AsVoidPtr(obj); c = (char *) PyCObject_GetDesc(obj); if (newref) Py_DECREF(obj); @@ -461,7 +461,7 @@ Py_DECREF(obj); goto type_error; } - } + } c = PyString_AsString(obj); /* Pointer values must start with leading underscore */ if (*c != '_') { @@ -641,11 +641,11 @@ /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_chmUnitInfo swig_types[0] -#define SWIGTYPE_p_unsigned_char swig_types[1] -#define SWIGTYPE_p_char swig_types[2] -#define SWIGTYPE_CHM_ENUMERATOR swig_types[3] -#define SWIGTYPE_p_chmFile swig_types[4] +#define SWIGTYPE_p_chmUnitInfo swig_types[0] +#define SWIGTYPE_p_unsigned_char swig_types[1] +#define SWIGTYPE_p_char swig_types[2] +#define SWIGTYPE_CHM_ENUMERATOR swig_types[3] +#define SWIGTYPE_p_chmFile swig_types[4] static swig_type_info *swig_types[6]; /* -------- TYPES TABLE (END) -------- */ @@ -676,7 +676,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - $Id: swig_chm.c,v 1.1.1.1 2003/12/02 12:38:14 rubensr Exp $ + $Id$ */ #include "chm_lib.h" #include @@ -701,8 +701,8 @@ return result; } -int dummy_enumerator (struct chmFile *h, - struct chmUnitInfo *ui, +int dummy_enumerator (struct chmFile *h, + struct chmUnitInfo *ui, void *context) { PyObject *arglist; PyObject *result; @@ -720,10 +720,10 @@ result = PyEval_CallObject(my_callback, arglist); Py_DECREF(arglist); Py_DECREF(result); - + Py_DECREF(py_h); Py_DECREF(py_ui); - + if (result == NULL) { return 0; /* Pass error back */ } else { @@ -738,23 +738,23 @@ PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; @@ -769,13 +769,13 @@ LONGUINT64 arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"OO:chmUnitInfo_start_set",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; arg2 = (LONGUINT64) PyLong_AsUnsignedLongLong(obj1); if (PyErr_Occurred()) SWIG_fail; if (arg1) (arg1)->start = arg2; - + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: @@ -788,11 +788,11 @@ struct chmUnitInfo *arg1 = (struct chmUnitInfo *) 0 ; LONGUINT64 result; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"O:chmUnitInfo_start_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; result = (LONGUINT64) ((arg1)->start); - + resultobj = PyLong_FromUnsignedLongLong(result); return resultobj; fail: @@ -806,13 +806,13 @@ LONGUINT64 arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"OO:chmUnitInfo_length_set",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; arg2 = (LONGUINT64) PyLong_AsUnsignedLongLong(obj1); if (PyErr_Occurred()) SWIG_fail; if (arg1) (arg1)->length = arg2; - + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: @@ -825,11 +825,11 @@ struct chmUnitInfo *arg1 = (struct chmUnitInfo *) 0 ; LONGUINT64 result; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"O:chmUnitInfo_length_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; result = (LONGUINT64) ((arg1)->length); - + resultobj = PyLong_FromUnsignedLongLong(result); return resultobj; fail: @@ -842,11 +842,11 @@ struct chmUnitInfo *arg1 = (struct chmUnitInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"Oi:chmUnitInfo_space_set",&obj0,&arg2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (arg1) (arg1)->space = arg2; - + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: @@ -859,11 +859,11 @@ struct chmUnitInfo *arg1 = (struct chmUnitInfo *) 0 ; int result; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"O:chmUnitInfo_space_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; result = (int) ((arg1)->space); - + resultobj = PyInt_FromLong((long)result); return resultobj; fail: @@ -876,7 +876,7 @@ struct chmUnitInfo *arg1 = (struct chmUnitInfo *) 0 ; char *arg2 ; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"Os:chmUnitInfo_path_set",&obj0,&arg2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { @@ -895,11 +895,11 @@ struct chmUnitInfo *arg1 = (struct chmUnitInfo *) 0 ; char *result; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"O:chmUnitInfo_path_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; result = (char *)(char *) ((arg1)->path); - + resultobj = PyString_FromString(result); return resultobj; fail: @@ -910,10 +910,10 @@ static PyObject *_wrap_new_chmUnitInfo(PyObject *self, PyObject *args) { PyObject *resultobj; struct chmUnitInfo *result; - + if(!PyArg_ParseTuple(args,(char *)":new_chmUnitInfo")) goto fail; result = (struct chmUnitInfo *)(struct chmUnitInfo *) calloc(1, sizeof(struct chmUnitInfo)); - + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_chmUnitInfo, 1); return resultobj; fail: @@ -925,11 +925,11 @@ PyObject *resultobj; struct chmUnitInfo *arg1 = (struct chmUnitInfo *) 0 ; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"O:delete_chmUnitInfo",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmUnitInfo,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; free((char *) arg1); - + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: @@ -948,10 +948,10 @@ PyObject *resultobj; char *arg1 ; struct chmFile *result; - + if(!PyArg_ParseTuple(args,(char *)"s:chm_open",&arg1)) goto fail; result = (struct chmFile *)chm_open((char const *)arg1); - + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_chmFile, 0); return resultobj; fail: @@ -963,11 +963,11 @@ PyObject *resultobj; struct chmFile *arg1 = (struct chmFile *) 0 ; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"O:chm_close",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmFile,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; chm_close(arg1); - + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: @@ -981,11 +981,11 @@ int arg2 ; int arg3 ; PyObject * obj0 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"Oii:chm_set_param",&obj0,&arg2,&arg3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmFile,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; chm_set_param(arg1,arg2,arg3); - + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: @@ -1001,14 +1001,14 @@ int result; struct chmUnitInfo *temp3 = (struct chmUnitInfo *) calloc(1, sizeof(struct chmUnitInfo)) ; PyObject * obj0 = 0 ; - + { arg3 = temp3; } if(!PyArg_ParseTuple(args,(char *)"Os:chm_resolve_object",&obj0,&arg2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmFile,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; result = (int)chm_resolve_object(arg1,(char const *)arg2,arg3); - + resultobj = PyInt_FromLong((long)result); { PyObject *o, *o2, *o3; @@ -1048,7 +1048,7 @@ PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; - + arg3 = &temp3; if(!PyArg_ParseTuple(args,(char *)"OOOO:chm_retrieve_object",&obj0,&obj1,&obj2,&obj3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmFile,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; @@ -1059,25 +1059,25 @@ if (PyErr_Occurred()) SWIG_fail; { /* nasty hack */ - - - + + + arg3 = (unsigned char *) malloc(arg5); - + if (arg3 == NULL) SWIG_fail; } result = (LONGINT64)chm_retrieve_object(arg1,arg2,arg3,arg4,arg5); - + resultobj = PyLong_FromLongLong(result); { PyObject *o; o = PyString_FromStringAndSize(arg3, arg5); resultobj = t_output_helper(resultobj,o); - - - + + + free(arg3); - + } return resultobj; fail: @@ -1095,7 +1095,7 @@ PyObject * obj0 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"OiOO:chm_enumerate",&obj0,&arg2,&obj2,&obj3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmFile,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { @@ -1106,7 +1106,7 @@ if (!(arg4 = PyCObject_FromVoidPtr(obj3, NULL))) goto fail; } result = (int)chm_enumerate(arg1,arg2,arg3,arg4); - + resultobj = PyInt_FromLong((long)result); return resultobj; fail: @@ -1125,7 +1125,7 @@ PyObject * obj0 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; - + if(!PyArg_ParseTuple(args,(char *)"OsiOO:chm_enumerate_dir",&obj0,&arg2,&arg3,&obj3,&obj4)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_chmFile,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { @@ -1136,7 +1136,7 @@ if (!(arg5 = PyCObject_FromVoidPtr(obj4, NULL))) goto fail; } result = (int)chm_enumerate_dir(arg1,(char const *)arg2,arg3,arg4,arg5); - + resultobj = PyInt_FromLong((long)result); return resultobj; fail: @@ -1176,11 +1176,11 @@ static swig_type_info _swigt__p_chmFile[] = {{"_p_chmFile", 0, "struct chmFile *", 0},{"_p_chmFile"},{0}}; static swig_type_info *swig_types_initial[] = { -_swigt__p_chmUnitInfo, -_swigt__p_unsigned_char, -_swigt__p_char, -_swigt__CHM_ENUMERATOR, -_swigt__p_chmFile, +_swigt__p_chmUnitInfo, +_swigt__p_unsigned_char, +_swigt__p_char, +_swigt__CHM_ENUMERATOR, +_swigt__p_chmFile, 0 }; @@ -1213,14 +1213,14 @@ extern "C" #endif SWIGEXPORT(void) SWIG_init(void) { - static PyObject *SWIG_globals = 0; + static PyObject *SWIG_globals = 0; static int typeinit = 0; PyObject *m, *d; int i; if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); m = Py_InitModule((char *) SWIG_name, SwigMethods); d = PyModule_GetDict(m); - + if (!typeinit) { for (i = 0; swig_types_initial[i]; i++) { swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); @@ -1228,6 +1228,5 @@ typeinit = 1; } SWIG_InstallConstants(d,swig_const_table); - -} +} diff -Nru pychm-0.8.4/chm/swig_chm.i pychm-0.8.4.1/chm/swig_chm.i --- pychm-0.8.4/chm/swig_chm.i 2004-01-07 00:22:36.000000000 +0000 +++ pychm-0.8.4.1/chm/swig_chm.i 2014-08-02 14:55:49.000000000 +0000 @@ -24,7 +24,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - $Id: swig_chm.i,v 1.1.1.1 2003/12/02 12:38:14 rubensr Exp $ + $Id$ */ #include "chm_lib.h" #include @@ -49,8 +49,8 @@ return result; } -int dummy_enumerator (struct chmFile *h, - struct chmUnitInfo *ui, +int dummy_enumerator (struct chmFile *h, + struct chmUnitInfo *ui, void *context) { PyObject *arglist; PyObject *result; @@ -68,10 +68,10 @@ result = PyEval_CallObject(my_callback, arglist); Py_DECREF(arglist); Py_DECREF(result); - + Py_DECREF(py_h); Py_DECREF(py_ui); - + if (result == NULL) { return 0; /* Pass error back */ } else { diff -Nru pychm-0.8.4/debian/changelog pychm-0.8.4.1/debian/changelog --- pychm-0.8.4/debian/changelog 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/changelog 2014-08-11 21:24:25.000000000 +0000 @@ -1,14 +1,31 @@ -pychm (0.8.4-1build2) precise; urgency=low +pychm (0.8.4.1-1) unstable; urgency=low - * Rebuild to drop python2.6 dependencies and provides. + [ Sandro Tosi ] + * New upstream release + * debian/control + - bump Standards-Version to 3.8.2 (no changes needed) + - switch me to Maintainer (team to Uploaders) + - updated upstream homepage + - removed useless fields from bin package + - bump Standards-Version to 3.9.5 (no changes needed) + - rename XS-P-V to X-P-V + - add python-setuptools to b-d + * debian/watch + - update to point to PyPI + * debian/copyright + - update and switch to DEP-5 format + * debian/docs + - removed NEWS, no longer shipped + * Switch to dh sequencer and dh_python2; Closes: #631400 + * debian/source/format + - switch to 3.0 (quilt) format + * debian/pycompat + - removed, no longer used - -- Matthias Klose Sat, 14 Apr 2012 13:43:21 +0000 + [ Jakub Wilk ] + * Use canonical URIs for Vcs-* fields. -pychm (0.8.4-1build1) natty; urgency=low - - * Rebuild to add support for python 2.7. - - -- Matthias Klose Fri, 03 Dec 2010 00:07:22 +0000 + -- Sandro Tosi Mon, 11 Aug 2014 22:24:24 +0100 pychm (0.8.4-1) unstable; urgency=low diff -Nru pychm-0.8.4/debian/compat pychm-0.8.4.1/debian/compat --- pychm-0.8.4/debian/compat 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/compat 2014-08-11 20:47:48.000000000 +0000 @@ -1 +1 @@ -5 +9 diff -Nru pychm-0.8.4/debian/control pychm-0.8.4.1/debian/control --- pychm-0.8.4/debian/control 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/control 2014-08-11 21:24:19.000000000 +0000 @@ -1,22 +1,18 @@ Source: pychm Section: python Priority: optional -Maintainer: Debian Python Modules Team -Uploaders: Sandro Tosi -Build-Depends: cdbs (>= 0.4.43), debhelper (>= 5.0.37.2), libchm-dev (>= 0.3), python-all-dev (>= 2.3.5-11), python-support (>= 0.3) -Standards-Version: 3.8.0 -XS-Python-Version: all -Homepage: http://gnochm.sourceforge.net/pychm.html -Vcs-Svn: svn://svn.debian.org/python-modules/packages/pychm/rtrunk/ -Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/pychm/trunk/ +Maintainer: Sandro Tosi +Uploaders: Debian Python Modules Team +Build-Depends: debhelper (>= 9), dh-python, libchm-dev (>= 0.3), python-all-dev (>= 2.3.5-11), python-setuptools +Standards-Version: 3.9.5 +X-Python-Version: all +Homepage: https://github.com/dottedmag/pychm +Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/pychm/trunk/ +Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/pychm/trunk/ Package: python-chm Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} -Provides: ${python:Provides} -XB-Python-Version: ${python:Versions} -Conflicts: python-pychm -Replaces: python-pychm Description: Python binding for CHMLIB PyCHM is a package that provides Python binding for Jed Wing's CHMLIB library. . diff -Nru pychm-0.8.4/debian/copyright pychm-0.8.4.1/debian/copyright --- pychm-0.8.4/debian/copyright 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/copyright 2014-08-11 20:26:18.000000000 +0000 @@ -1,36 +1,33 @@ -This package was debianized by Carlos Z.F. Liu on -Fri, 10 Sep 2004 04:10:12 +1200. - -It was downloaded from http://gnochm.sourceforge.net/pychm.html - -Upstream Author: - - Rubens Ramos - -Copyright: - - Copyright (C) 2003-2006 Rubens Ramos - -License: - - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This package 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU General -Public License v2 can be found in `/usr/share/common-licenses/GPL-2'. - -These files have a different copyright notices: -./chm/{chm.py, swig_chm.i} - Based on code by: - Copyright (C) 2003 Razvan Cojocaru +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: PyCHM +Source: https://github.com/dottedmag/pychm + +Files: * +Copyright: Copyright (C) 2003-2006 Rubens Ramos + Copyright (C) 2014 Mikhail Gusarov +License: GPL-2+ + +Files: debian/* +Copyright: Copyright (C) 2009-2014, Sandro Tosi +License: GPL-2+ + +Files: chm/chm.py chm/swig_chm.i +Copyright: Copyright (C) 2003 Razvan Cojocaru + +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package 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 General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU General + Public License v2 can be found in `/usr/share/common-licenses/GPL-2'. diff -Nru pychm-0.8.4/debian/docs pychm-0.8.4.1/debian/docs --- pychm-0.8.4/debian/docs 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/docs 2014-08-11 20:28:30.000000000 +0000 @@ -1,2 +1 @@ -NEWS README diff -Nru pychm-0.8.4/debian/pycompat pychm-0.8.4.1/debian/pycompat --- pychm-0.8.4/debian/pycompat 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/pycompat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2 diff -Nru pychm-0.8.4/debian/rules pychm-0.8.4.1/debian/rules --- pychm-0.8.4/debian/rules 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/rules 2014-08-11 20:47:48.000000000 +0000 @@ -1,8 +1,4 @@ #!/usr/bin/make -f -# -*- mode: makefile; coding: utf-8 -*- - -DEB_PYTHON_SYSTEM=pysupport - -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/python-distutils.mk +%: + dh $@ --with python2 diff -Nru pychm-0.8.4/debian/source/format pychm-0.8.4.1/debian/source/format --- pychm-0.8.4/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ pychm-0.8.4.1/debian/source/format 2014-08-11 21:08:06.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru pychm-0.8.4/debian/watch pychm-0.8.4.1/debian/watch --- pychm-0.8.4/debian/watch 2014-10-27 08:32:25.000000000 +0000 +++ pychm-0.8.4.1/debian/watch 2014-08-10 14:09:51.000000000 +0000 @@ -1,3 +1,2 @@ version=3 - -http://sf.net/gnochm/pychm-([0-9\.]*)\.tar\.gz +https://pypi.python.org/packages/source/p/pychm/pychm-(.*)\.tar.gz diff -Nru pychm-0.8.4/MANIFEST.in pychm-0.8.4.1/MANIFEST.in --- pychm-0.8.4/MANIFEST.in 1970-01-01 00:00:00.000000000 +0000 +++ pychm-0.8.4.1/MANIFEST.in 2014-08-03 06:27:06.000000000 +0000 @@ -0,0 +1,2 @@ +include COPYING +include chm/swig_chm.i diff -Nru pychm-0.8.4/NEWS pychm-0.8.4.1/NEWS --- pychm-0.8.4/NEWS 2006-11-11 06:41:47.000000000 +0000 +++ pychm-0.8.4.1/NEWS 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -0.8.4 - * Word search (does not apply to whole words) is not case sensitive - anymore (Glenn Washburn) - * Fixed cases where contents tab was not being displayed (#1563936). - ---------------------------------------------------------------------------- -0.8.3 - * Fixing identification of Cyrillic language (cp1251). - * Bug #1464957: Using #WINDOWS and #STRINGS to obtain default page. - (this caused gnochm to crash when opening certain files, or to simply - show nothing as the startup page) ---------------------------------------------------------------------------- -0.8.2 - - * Identification of index file was slightly improved. ---------------------------------------------------------------------------- -0.8.1 - - * Bug #1039336: Chinese characters can't be displayed correctly - Improved detection of character set encoding ---------------------------------------------------------------------------- -0.8.0 - - * Added support to access the LCID from a CHM archive - this - functionality is now required by gnochm 0.8.0 ---------------------------------------------------------------------------- -0.7.0 - - * Added support to search for words inside CHM archives. This was - implemented in a separate module (chm.extra) and is used in - chm.chm. - * Added method to CHMFile to read the archive encoding, so that - python codecs can be used to encode/decode contents of html files. ---------------------------------------------------------------------------- -0.6.0 - - * Removed IndexParser and other tree-related classes and functions from - chm.py (chm.chm), because the tree structure was causing memory leaks - in gnochm. GetIndex and GetTopics now return raw text. HTML parsing - is not done inside the chm package anymore. - * Documentation added to the Python wrappers in chm.py ---------------------------------------------------------------------------- -0.5.0 - - * First public release ---------------------------------------------------------------------------- diff -Nru pychm-0.8.4/PKG-INFO pychm-0.8.4.1/PKG-INFO --- pychm-0.8.4/PKG-INFO 2006-11-11 06:46:39.000000000 +0000 +++ pychm-0.8.4.1/PKG-INFO 2014-08-03 16:33:39.000000000 +0000 @@ -1,10 +1,15 @@ Metadata-Version: 1.0 Name: pychm -Version: 0.8.4 +Version: 0.8.4.1 Summary: Python package to handle CHM files -Home-page: http://gnochm.sourceforge.net -Author: Rubens Ramos -Author-email: rubensr@users.sourceforge.net +Home-page: https://github.com/dottedmag/pychm +Author: Mikhail Gusarov +Author-email: dottedmag@dottedmag.net License: GPL -Description: The chm package provides three modules, chm, chmlib and extra, which provide access to the API implemented by the C library chmlib and some additional classes and functions. They are used to access MS-ITSS encoded files - Compressed Html Help files (.chm). +Description: + The chm package provides three modules, chm, chmlib and extra, which provide + access to the API implemented by the C library chmlib and some additional + classes and functions. They are used to access MS-ITSS encoded files - + Compressed Html Help files (.chm). + Platform: UNKNOWN diff -Nru pychm-0.8.4/pychm.egg-info/dependency_links.txt pychm-0.8.4.1/pychm.egg-info/dependency_links.txt --- pychm-0.8.4/pychm.egg-info/dependency_links.txt 1970-01-01 00:00:00.000000000 +0000 +++ pychm-0.8.4.1/pychm.egg-info/dependency_links.txt 2014-08-03 16:33:39.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru pychm-0.8.4/pychm.egg-info/PKG-INFO pychm-0.8.4.1/pychm.egg-info/PKG-INFO --- pychm-0.8.4/pychm.egg-info/PKG-INFO 1970-01-01 00:00:00.000000000 +0000 +++ pychm-0.8.4.1/pychm.egg-info/PKG-INFO 2014-08-03 16:33:39.000000000 +0000 @@ -0,0 +1,15 @@ +Metadata-Version: 1.0 +Name: pychm +Version: 0.8.4.1 +Summary: Python package to handle CHM files +Home-page: https://github.com/dottedmag/pychm +Author: Mikhail Gusarov +Author-email: dottedmag@dottedmag.net +License: GPL +Description: + The chm package provides three modules, chm, chmlib and extra, which provide + access to the API implemented by the C library chmlib and some additional + classes and functions. They are used to access MS-ITSS encoded files - + Compressed Html Help files (.chm). + +Platform: UNKNOWN diff -Nru pychm-0.8.4/pychm.egg-info/SOURCES.txt pychm-0.8.4.1/pychm.egg-info/SOURCES.txt --- pychm-0.8.4/pychm.egg-info/SOURCES.txt 1970-01-01 00:00:00.000000000 +0000 +++ pychm-0.8.4.1/pychm.egg-info/SOURCES.txt 2014-08-03 16:33:39.000000000 +0000 @@ -0,0 +1,14 @@ +COPYING +MANIFEST.in +README +setup.py +chm/__init__.py +chm/chm.py +chm/chmlib.py +chm/extra.c +chm/swig_chm.c +chm/swig_chm.i +pychm.egg-info/PKG-INFO +pychm.egg-info/SOURCES.txt +pychm.egg-info/dependency_links.txt +pychm.egg-info/top_level.txt \ No newline at end of file diff -Nru pychm-0.8.4/pychm.egg-info/top_level.txt pychm-0.8.4.1/pychm.egg-info/top_level.txt --- pychm-0.8.4/pychm.egg-info/top_level.txt 1970-01-01 00:00:00.000000000 +0000 +++ pychm-0.8.4.1/pychm.egg-info/top_level.txt 2014-08-03 16:33:39.000000000 +0000 @@ -0,0 +1 @@ +chm diff -Nru pychm-0.8.4/README pychm-0.8.4.1/README --- pychm-0.8.4/README 2006-11-11 06:43:17.000000000 +0000 +++ pychm-0.8.4.1/README 2014-08-03 06:10:50.000000000 +0000 @@ -1,138 +1,21 @@ - PyCHM +PyCHM +===== - Version 0.8.4 +PyCHM is a Python library to manipulate CHM files (Microsoft HTML Help). - Copyright (C) 2003-2006 Rubens Ramos +The chm package contains four modules: - Please report bugs or suggestions for improvements to the above - address or follow the instructions at: - - http://gnochm.sourceforge.net - ----------------------------------------------------------------------------- -Summary -------- - - PyCHM contains a Python package named chm to manipulate CHM -archive. It uses the functionality implemented in chmlib, a C-based -library written by Jed Wing. Quoted from Jed's README: - -"chmlib is a small library designed for accessing MS ITSF files. The -ITSF file format is used for Microsoft Html Help files (.chm), which -have been the predominant medium for software documentation from -Microsoft during the past several years, having superceded the -previously used .hlp file format." - - The chm package contains four modules: - - * chm._chmlib: Low level wrappers around the chmlib API, generated by - SWIG - . - * chm.chmlib: Low level wrappers around the chmlib API, also generated - by SWIG; - * chm.extra: Extra utility functions - right now, it contains a - function to perform full-text search support to extract LCID. - * chm.chm: High-level support for CHM archives, using the functions - from the modules above. - -Requirements ------------- - - * Python >= 2.2 (older versions may work, I dont know) - * chmlib - * A working C compiler if you plan to build the sources. - * SWIG *if* you really want to regenerate the sources from the interface - file (but this is not needed - keep reading). To get SWIG, go to - http://www.swig.org - -Installation ------------- - - First you need to get Python and chmlib at: - - http://www.python.org - http://66.93.236.84/~jedwin/projects/chmlib - - and install both of these packages. - - Installation from sources - ------------------------- - - If you are getting one of the source files, then all you need to do is - unpack it, 'cd' to the newly created 'pychm-X.X.X' directory and type: - - python setup.py install - - And that should be all. Note that you will probably need to have admin - privileges to do that if you are planning to install it on the base python - modules directory. - - If you are feeling adventurous and want to re-generate the C source file - from the SWIG interface file (src/swig_chm.i), then all you need to do - is modify the setup.py file and substitute src/swig_chm.c with - src/swig_chm.i (I used SWIG 1.13.18 to develop this). - - Tip - if the compilation is failing because your chmlib is installed - somewhere not visible to gcc, then you can use the cPATH and - LIBRARY_PATH environment variables before trying to compile: - - (if you are using bash, or sh-like shells) - export CPATH= - export LIBRARY_PATH= - - or - - (if you are using tcsh, csh, etc) - setenv CPATH - setenv LIBRARY_PATH - - Installation from binaries - -------------------------- - - Just grab your favorite binary format, and install it according to your - system's procedures (since you know which format you want, I am - assuming you know how to install it :) - - RPM installation - ---------------- - - Just do (but make sure you have chmlib installed first): - - rpm -i pychm-X.X.X-X.i386.rpm - -Acknowledgements ----------------- - This work would not have been possible without the existence of chmlib, -developed by Jed Wing, and a lot of the python code used to parse the -contents tree and to decode the index files was heavily based on the -code implemented by Razvan Cojocaru for the xCHM -viewer. - - Bug reports: - - can3p, Chang (changshu), Hristo Iliev, Carlos Liu, Torsten Marek, - Dmitri (nebraskin), Fredrik de Vibe, Glenn Washburn - -FAQ ---- - - Q. I want to re-generate the C source from the swig interface file! How - do I do that? - A. Modify the setup.py file and substitute src/swig_chm.c with - src/swig_chm.i (I used SWIG 1.13.18 to develop this). +* chm.chm: High-level support for CHM archives. +* chm.extra: Extra utility functions - full-text search support, + encoding detection. +* chm._chmlib: Low level wrappers around the chmlib API (C part). +* chm.chmlib: Low level wrappers around the chmlib API (Python part). License ------- - This library is licensed under the GPL. Please refer to the COPYING file -for more details. - -Bugs ----- - - If you think you found a bug, or have suggestions for improvements, you -can contact the author at: - -Rubens Ramos +Copyright (C) 2003-2006 Rubens Ramos +Copyright (C) 2014 Mikhail Gusarov -$Id: README,v 1.14 2006/11/11 06:43:17 rubensr Exp $ +This library is licensed under the GPLv2+. Please refer to the COPYING file for +more details. diff -Nru pychm-0.8.4/setup.cfg pychm-0.8.4.1/setup.cfg --- pychm-0.8.4/setup.cfg 2006-04-08 05:44:17.000000000 +0000 +++ pychm-0.8.4.1/setup.cfg 2014-08-03 16:33:39.000000000 +0000 @@ -1,10 +1,5 @@ -[bdist_rpm] -release = 1fc5 -packager = Rubens Ramos -build_requires = python -requires = python - libchm -doc_files = README - NEWS - COPYING - ChangeLog +[egg_info] +tag_build = +tag_date = 0 +tag_svn_revision = 0 + diff -Nru pychm-0.8.4/setup.py pychm-0.8.4.1/setup.py --- pychm-0.8.4/setup.py 2006-06-18 10:46:27.000000000 +0000 +++ pychm-0.8.4.1/setup.py 2014-08-03 16:30:37.000000000 +0000 @@ -1,22 +1,29 @@ -import distutils -from distutils.core import setup, Extension +from setuptools import setup, Extension + +long_description = ''' +The chm package provides three modules, chm, chmlib and extra, which provide +access to the API implemented by the C library chmlib and some additional +classes and functions. They are used to access MS-ITSS encoded files - +Compressed Html Help files (.chm). +''' setup(name="pychm", - version="0.8.4", + version="0.8.4.1", description="Python package to handle CHM files", author="Rubens Ramos", author_email="rubensr@users.sourceforge.net", - url="http://gnochm.sourceforge.net", + maintainer="Mikhail Gusarov", + maintainer_email="dottedmag@dottedmag.net", + url="https://github.com/dottedmag/pychm", license="GPL", - long_description="The chm package provides three modules, chm, chmlib and extra, which provide access to the API implemented by the C library chmlib and some additional classes and functions. They are used to access MS-ITSS encoded files - Compressed Html Help files (.chm).", - py_modules = ["chm.chm", "chm.chmlib"], - ext_modules = [Extension("chm._chmlib", - ["chm/swig_chm.c"], - libraries=["chm"], - extra_compile_args=["-DSWIG_COBJECT_TYPES"], - ), - Extension("chm.extra", - ["chm/extra.c"], - extra_compile_args=["-D__PYTHON__"], - libraries=["chm"])] + long_description=long_description, + py_modules=["chm.chm", "chm.chmlib"], + ext_modules=[Extension("chm._chmlib", + ["chm/swig_chm.c"], + libraries=["chm"], + extra_compile_args=["-DSWIG_COBJECT_TYPES"]), + Extension("chm.extra", + ["chm/extra.c"], + extra_compile_args=["-D__PYTHON__"], + libraries=["chm"])] )