|
From: <di...@us...> - 2011-06-11 15:52:33
|
Revision: 755
http://safekeep.svn.sourceforge.net/safekeep/?rev=755&view=rev
Author: dimi
Date: 2011-06-11 15:52:27 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
Have 'try_to_run' return the captured output of the command
rather than just a boolean for additional flexibility.
Modified Paths:
--------------
safekeep/trunk/safekeep
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2011-06-11 15:20:25 UTC (rev 754)
+++ safekeep/trunk/safekeep 2011-06-11 15:52:27 UTC (rev 755)
@@ -237,8 +237,10 @@
try:
rc, out = do_spawn(args, None, True)
except OSError, ex:
- return False
- return rc in (0,1)
+ return None
+ if not rc in (0,1):
+ return None
+ return out or ''
def send_notification(email, smtp):
global logbuf
@@ -914,7 +916,7 @@
ionice_cmd = 'ionice'
if ionice and ionice != 'none':
- if try_to_run(ionice_cmd):
+ if try_to_run(ionice_cmd) is not None:
if ionice is 'idle':
args.extend([ionice_cmd, '-c3', '-t'])
else:
@@ -938,7 +940,7 @@
if limit_ul:
trickle.extend(['-u', str(limit_ul)])
if len(trickle):
- if not try_to_run([trickle_cmd, '-V']):
+ if try_to_run([trickle_cmd, '-V']) is not None:
warn('Trickle not available, bandwidth limiting disabled')
trickle = []
args.extend(trickle)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|