Avdump GUI: Difference between revisions

Jump to navigation Jump to search
751 bytes removed ,  13 November 2007
m
No edit summary
Line 110: Line 110:
             #self.child.info(('%s%s -ac:%s:%s %s') %(self.__options['avdump'], self.__options['param'], self.__options['user'], self.__options['pass'], self.__options['scanpath']))
             #self.child.info(('%s%s -ac:%s:%s %s') %(self.__options['avdump'], self.__options['param'], self.__options['user'], self.__options['pass'], self.__options['scanpath']))
             arg = (u'%s%s -ac:%s:%s %s') %(self.__options['avdump'], self.__options['param'], self.__options['user'], self.__options['pass'], self.__options['scanpath'])
             arg = (u'%s%s -ac:%s:%s %s') %(self.__options['avdump'], self.__options['param'], self.__options['user'], self.__options['pass'], self.__options['scanpath'])
            print arg
             subprocessw.Popen(arg)
             subprocessw.Popen(arg)


Line 372: Line 371:
</pre>
</pre>


===wrapper module for subprocess by rar===
<pre  style="font-size: 60%;">
<pre  style="font-size: 60%;">
import subprocess
import subprocess
from subprocess import call, PIPE, STDOUT, list2cmdline, mswindows, STARTF_USESTDHANDLES
from subprocess import call, PIPE, STDOUT, list2cmdline, mswindows
import ctypes
import ctypes
import ctypes.wintypes
import ctypes.wintypes
Line 408: Line 408:
("dwThreadId", ctypes.wintypes.DWORD))
("dwThreadId", ctypes.wintypes.DWORD))


class Popen(subprocess.Popen):
if mswindows:
"""def __init__(self, args, bufsize=0, executable=None,
class Popen(subprocess.Popen):
stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False,
cwd=None, env=None, universal_newlines=False,
startupinfo=None, creationflags=0):
print "BOOM"
subprocess.Popen.__init__(self, args, bufsize, executable,
stdin, stdout, stderr, preexec_fn, close_fds, shell,
cwd, env, universal_newlines, startupinfo, creationflags)"""
if mswindows:
def _execute_child(self, args, executable, preexec_fn, close_fds,
def _execute_child(self, args, executable, preexec_fn, close_fds,
cwd, env, universal_newlines,
cwd, env, universal_newlines,
Line 436: Line 427:
return
return


default_startupinfo = STARTUPINFOW()
if startupinfo == None:
if startupinfo == None:
startupinfo = default_startupinfo
startupinfo = STARTUPINFOW()
else:
else:
raise NotImplementedError("Can't pass startup stuff")
raise NotImplementedError("Can't pass startup stuff")
Line 444: Line 434:
if not None in (p2cread, c2pwrite, errwrite):
if not None in (p2cread, c2pwrite, errwrite):
raise NotImplementedError("Can't pass file object bits")
raise NotImplementedError("Can't pass file object bits")
startupinfo.dwFlags |= STARTF_USESTDHANDLES
startupinfo.hStdInput = p2cread #.Detatch()
startupinfo.hStdOutput = c2pwrite
startupinfo.hStdError = errwrite


if shell:
if shell:
Line 469: Line 455:
self.pid = pid
self.pid = pid
CloseHandle(ht) # ht.Close()
CloseHandle(ht) # ht.Close()
 
else:
if p2cread != None:
Popen = subprocess.Popen
p2cread.Close()
if c2pwrite != None:
c2pwrite.Close()
if errwrite != None:
errwrite.Close()
</pre>
</pre>


[[Category:Avdump]]
[[Category:Avdump]]

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.