FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > EPEL Development

 
 
LinkBack Thread Tools
 
Old 05-20-2010, 03:22 PM
Ales Kozumplik
 
Default logging: simplify stdout logging in execWithCallback().

---
iutil.py | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/iutil.py b/iutil.py
index 63582c4..d026bcf 100644
--- a/iutil.py
+++ b/iutil.py
@@ -294,7 +294,7 @@ def execWithCallback(command, argv, stdin = None, stdout = None,
os.close(p[1])
os.close(p_stderr[1])

- logline = '
+ log_output = '
while 1:
try:
s = os.read(p[0], 1)
@@ -304,12 +304,7 @@ def execWithCallback(command, argv, stdin = None, stdout = None,

if echo:
os.write(stdout, s)
-
- if s == '
':
- program_log.info(logline)
- logline = '
- else:
- logline += s
+ log_output += s

if callback:
callback(s, callback_data=callback_data)
@@ -325,8 +320,8 @@ def execWithCallback(command, argv, stdin = None, stdout = None,

if len(s) < 1:
break
- if len(logline) > 0:
- program_log.info(logline)
+
+ map(program_log.info, log_output.splitlines())

log_errors = '
while 1:
--
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org