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