X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=wx%2Fgui%2Fplugin.py;fp=wx%2Fgui%2Fplugin.py;h=f58cc50fc577c8e17a1380b942ce3ea57c7b61cd;hp=5cdc2a6fdd21d892c8311c62a64fcdc85453e76a;hb=9f03f91142fe3b2d37089d164f1670cf8dc4beb6;hpb=6468644eca8b699a42a9c68048da87b90764f385 diff --git a/wx/gui/plugin.py b/wx/gui/plugin.py index 5cdc2a6..f58cc50 100644 --- a/wx/gui/plugin.py +++ b/wx/gui/plugin.py @@ -29,6 +29,8 @@ from wx.lib.pubsub import Publisher from subprocess import Popen, PIPE class Plugin: + one_page_per_file = False + def before_render(self): pass @@ -44,11 +46,16 @@ class Plugin: def __find_swfcombine(self): found = False - prog = "swfcombine.exe" if "wxMSW" in wx.PlatformInfo else "swfcombine" - basedir = os.path.dirname(__file__) + if "wxMSW" in wx.PlatformInfo: + prog = "swfcombine.exe" + else: + prog = "swfcombine" + #basedir = os.path.dirname(__file__) + basedir = GPDF2SWF_BASEDIR + #print 'basedir', basedir opj = os.path.join - locations = [opj(basedir, prog)] + locations = [os.path.normpath(opj(basedir, '..', prog))] if "wxMSW" in wx.PlatformInfo: locations.extend([ opj("c:", "swftools", prog), @@ -56,16 +63,20 @@ class Plugin: ]) else: locations.extend([ - opj(os.sep, "usr", "local", "bin", prog), - opj(os.sep, "usr", "bin", prog), + opj("/usr", "local", "bin", prog), + opj("/usr", "bin", prog), + opj(basedir, '..', 'src', prog), ]) + #print locations exe = prog for e in locations: + #print e if os.path.isfile(e): exe = e found = True break + #print exe, found return exe, found def swfcombine(self, *args): @@ -88,7 +99,17 @@ class Plugin: cmd = [exe,] cmd.extend(args) - output = Popen(cmd, stdout=PIPE).communicate()[0] + if "wxMSW" in wx.PlatformInfo: + try: + import win32process + # To avoid an ugly "DOS Window" to show up + flags = win32process.CREATE_NO_WINDOW + except ImportError: + flags = 0 + else: + flags = 0 + output = Popen(cmd, stdin=PIPE, stdout=PIPE, + stderr=PIPE, creationflags=flags).communicate()[0] # Check the process output if output: