![]() ![]() Also, do not forget that Compiled HTML Help Files can contain web pages with malicious code, thus posing a security threat. That said, I believe that this format, in addition to being proprietary and obsolete (Microsoft itself abandoned its use), can be replaced by other equally valid and functional free alternatives (PDF, DJVU, etc.). chm file consists of an index, a table of contents, and a set of HTML pages hyperlinked to the table, which are compressed to generate the help file. Installation in Ubuntu and derivatives: sudo apt-get install chmsee Final wordsįinally, if you are a true geek, you can unzip the CHM file and navigate the HTML pages manually. Because it uses the Gecko rendering engine (yes, the same one that Firefox uses), ChmSee supports HTML and CSS perfectly. On Ubuntu and derivatives: sudo apt-get install libchm-bin ChmSeeĬhmSee is based on CHMLIB and uses GTK for its implementation. Okular, the default document viewer in KDE also includes support for CHM files, but this requires installing libchm libraries. Installation in Ubuntu and derivatives: sudo apt-get install kchmviewer Okular It has not received updates for a while but it is fully functional. write ( 'usage: \n\t %s \n\n on Unix you can use pipe to c' 'onvert chm to ascii \n\t %s foo.chm | lynx -dump -stdin > foo.' 'txt \n or \n\t %s foo.chm | html2text -style pretty | foo.txt \n y' 'ou can also save the output as commepresed gzip file \n\t %s f' 'oo.chm | html2text -style pretty | gzip | foo.gz \n and read i' 't with zless: \n\t zless foo.Kchmviewer is the client to view CHM files that comes by default with KDE. This will open a list of apps on a sub-menu. ![]() 2 Hover over Open with on the right-click menu. close () # fix absolute path if nessesery for obj in nodes : if obj != '/' : obj = home_dir obj return nodes def usage (): """print usage on stderr.""" filename = basename ( argv ) # don't brake unix pipe, send usege to stderr stderr. Locate the CHM file you want to open on your computer, and right-click on the file icon to open the context menu. _get_contents ( home_dir local ) parser. links : local, name = obj, obj if regx. feed ( obj ) # sometimes the first page of archive contains link to its # Content Tree regx = re. home ) if not obj : raise ChmFileException, "Can't find Content Tree" parser. nodes else : # try to locate Table of Contents obj = self. RetrieveObject ( self, obj ) return html def _get_nodes ( self ): """return list of dictionaries with data extracted from TopicsTree.""" parser = LinksLocator () home_dir = self. ResolveObject ( self, path ) if obj != 0 : return None html = CHMFile. 1-Download and install the HTML Help Workshop program on a Windows VM 2- Download the Nishang module for creating custom payloads for CHM files - Out-CHM Module from GitHub. nodes : raise ChmFileException, "Can't find Content Tree" def _get_contents ( self, path ): """return html contents of file `path' in chm archive.""" obj = CHMFile. API The chm package contains four modules: chm.chm: High-level support for CHM archives. It is in a maintenance mode and accepts only security and bug fixes. This library supports Python 2.7 and Python 3.5 . LoadCHM ( self, filename ) != 1 : raise IOError, "Can't load File ' %s '" % filename self. Project description P圜HM is a Python library to manipulate CHM files (Microsoft HTML Help). _get_contents ( node ) def open ( self, filename ): if CHMFile. ![]() open ( filename ) def _iter_ ( self ): """return generator over pages in Content Tree.""" for node in self. print page the output will be html content of compresed chm file """ def _init_ ( self, filename = None ): CHMFile. ![]() data = data class ChmFileException ( Exception ): pass class SimpleChmFile ( CHMFile ): """ SimpleChmFile is a wraper over CHMFile in witch you can iterate over pages eg.: > chm = SimpleChmFile('file.chm') > for page in chm. lnk ) def handle_data ( self, data ): if self. in_a = False # if link has an adress if self. links = def handle_starttag ( self, tag, attr ): if tag = 'object' : self. Open hh.exe that comes with wine and browse for your CHM file from it, or supply it as a command line argument: wine /usr/lib/x8664-linux-gnu/wine-development/fakedlls/hh.exe WindowsHalp. #!/usr/bin/env python from chm.chm import CHMFile from os.path import basename, exists, abspath from HTMLParser import HTMLParser from sys import argv, exit, stderr import re class LinksLocator ( HTMLParser ): """ LinksLocator is a class for retrieve name and path (Name and Local) from TopicsTree in chm (compresed html) archive file or simple html links """ def _init_ ( self ): HTMLParser. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |