-d çıktı versin...
This commit is contained in:
@@ -200,4 +200,4 @@ def dirName(sourceFile):
|
||||
|
||||
def system(command):
|
||||
command = command.replace(" ", "")
|
||||
run_batch(command)
|
||||
run_batch(command, True)
|
||||
|
||||
+14
-6
@@ -125,16 +125,24 @@ def remove_prefix(a,b):
|
||||
# Process Releated Functions #
|
||||
##############################
|
||||
|
||||
def run_batch(cmd):
|
||||
"""run command non-interactively and report return value and output"""
|
||||
def run_batch(cmd, realtime = False):
|
||||
"""run command non-interactively/realtime and report return value and output"""
|
||||
ctx.ui.info(_('running ') + cmd)
|
||||
a = os.popen(cmd)
|
||||
lines = a.readlines()
|
||||
ret = a.close()
|
||||
p = os.popen(cmd)
|
||||
if realtime:
|
||||
while 1:
|
||||
line = p.readline()
|
||||
if not line:
|
||||
break
|
||||
ctx.ui.debug(line[:-1])
|
||||
return p.close()
|
||||
else:
|
||||
lines = p.readlines()
|
||||
ret = p.close()
|
||||
ctx.ui.debug(_('return value %s') % ret)
|
||||
successful = ret == None
|
||||
if not successful:
|
||||
ctx.ui.error(_('Failed command: %s') % cmd + strlist(lines))
|
||||
ctx.ui.error(_('Failed command: %s') % cmd + strlist(lines))
|
||||
return (successful,lines)
|
||||
|
||||
######################
|
||||
|
||||
Reference in New Issue
Block a user