diff options
author | Timo Richter <timo@iera.de> | 2011-08-26 14:03:25 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-08-26 14:03:56 +0200 |
commit | ba84d4ed501e1ae10683c2edf72ef2d3944e1333 (patch) | |
tree | da20dfa3d59c961dd432e462fb8f5d58a78bb955 /helpcontent2/wiki-to-help/hhc.py | |
parent | 96210e715d167f793ce8830b4152f3327c265552 (diff) |
Index is being created. Images are included in chm-files.
--images accepts zip files
Program output is more quiet
Added -v for verbosity
Call of "convert.py" -h is a lot faster
Diffstat (limited to 'helpcontent2/wiki-to-help/hhc.py')
-rw-r--r-- | helpcontent2/wiki-to-help/hhc.py | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/helpcontent2/wiki-to-help/hhc.py b/helpcontent2/wiki-to-help/hhc.py index d2d8302604..dc7a54daaa 100644 --- a/helpcontent2/wiki-to-help/hhc.py +++ b/helpcontent2/wiki-to-help/hhc.py @@ -1,22 +1,25 @@ -import platform, os, subprocess +import platform, os +from executor import Executor class HHC(object): """ Class for execution of Html Help Compiler """ hhcexe="c:\\htmlhelp\\hhc.exe" - def __init__(self): - pass + def __init__(self,**args): + """ + @args Arguments for Executor.__init__() + """ + self.args=args def exWindows(self,source): """ Private. Compile @source calling HHC natively under Windows """ cmd=[self.hhcexe,os.path.join(source,"htmlhelp.hhp")] - r = (subprocess.Popen(cmd).wait()) - return r + return Executor(**self.args).executor(*tuple(cmd)) def exWine(self,source): """ Private. Compile @source calling HHC via Wine """ #dirname = os.path.dirname(source) - wine = Wine(source,"j:") + wine = Wine(source,"j:",self.args) r = wine(self.hhcexe,"j:\\htmlhelp.hhp") del wine return r @@ -34,10 +37,13 @@ class HHC(object): class Wine(object): # TODO: this should be a singleton - def __init__(self,workingDir,driveletter): - """ Setup the wine environment. Granting access so that wine is able to output files to @workingDir. + def __init__(self,workingDir,driveletter,args={}): + """ + Setup the wine environment. Granting access so that wine is able @workingDir will be accessable via @driveletter - E.g. Wine("/tmp/dir","j:") """ + @args Arguments for Executor as dict (**args) + E.g. Wine("/tmp/dir","j:") + """ homedir = os.path.expanduser('~') wineprefix=os.path.join(homedir,".wine") drive=os.path.join(wineprefix,"dosdevices",driveletter) @@ -47,13 +53,13 @@ class Wine(object): os.symlink(workingDir,drive) self.drive = drive #self.driveBak = driveBak + self.executor = Executor(**args) def ex(self,*cmd): """ execute something with wine """ cmd = [elem for elem in cmd] cmd = ["/usr/bin/wine"]+cmd - r= (subprocess.Popen(cmd).wait()) - return r + return self.executor(*tuple(cmd)) def __call__(self,*cmd): return self.ex(*cmd) |