git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
applied hide_doc.patch from Ricardo Pedroso
[swftools.git]
/
wx
/
gui
/
plugin.py
diff --git
a/wx/gui/plugin.py
b/wx/gui/plugin.py
index
5cdc2a6
..
ad52e45
100644
(file)
--- 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:
from subprocess import Popen, PIPE
class Plugin:
+ one_page_per_file = False
+
def before_render(self):
pass
def before_render(self):
pass
@@
-44,28
+46,49
@@
class Plugin:
def __find_swfcombine(self):
found = False
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
opj = os.path.join
- locations = [opj(basedir, prog)]
+ locations = [
+ os.path.normpath(opj(basedir, prog)),
+ os.path.normpath(opj(basedir, "..", "src", prog)),
+ ]
if "wxMSW" in wx.PlatformInfo:
if "wxMSW" in wx.PlatformInfo:
+ try:
+ system_drive = os.environ['SYSTEMDRIVE']
+ except KeyError:
+ system_drive = 'c:'
+ try:
+ program_files = os.environ['PROGRAMFILES']
+ except KeyError:
+ program_files = ''
locations.extend([
locations.extend([
- opj("c:", "swftools", prog),
- opj("c:", "Program Files", "SWFTools", prog)
+ opj("c:", os.sep, "swftools", prog),
+ opj("c:", os.sep, "Program Files", "SWFTools", prog),
+ opj(system_drive, os.sep, program_files, "SWFTools", prog),
])
else:
locations.extend([
])
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:
exe = prog
for e in locations:
+ #print e
if os.path.isfile(e):
exe = e
found = True
break
if os.path.isfile(e):
exe = e
found = True
break
+ #print exe, found
return exe, found
def swfcombine(self, *args):
return exe, found
def swfcombine(self, *args):
@@
-88,7
+111,19
@@
class Plugin:
cmd = [exe,]
cmd.extend(args)
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:
+ # See http://msdn.microsoft.com/en-us/library/ms684863(VS.85).aspx
+ # for this flag (CREATE_NO_WINDOW) value
+ flags = 0x08000000
+ else:
+ flags = 0
+ output = Popen(cmd, stdin=PIPE, stdout=PIPE,
+ stderr=PIPE, creationflags=flags).communicate()[0]
# Check the process output
if output:
# Check the process output
if output: