[sysadmin-bin] ftpadmin: Keep StringIO files in memory



commit 47aca5cbc201d72f0fa015e527032236b07bd56a
Author: Olav Vitters <olav vitters nl>
Date:   Sat Mar 19 12:00:59 2011 +0100

    ftpadmin: Keep StringIO files in memory

 ftpadmin |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index 5e3c2c1..7f17bb2 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -1079,9 +1079,8 @@ def cmd_release_news(options, parser, header=None):
         diffs = new_tarinfo.diff((fn, ), prev_tarinfo, constructor, progress=False)
 
         if fn in diffs:
-            f = diffs[fn]
-            f.seek(0)
-            news[module] = f.read()
+            news[module] = diffs[fn]
+            news[module].seek(0)
     if did_header:
         print ""
 
@@ -1093,7 +1092,7 @@ def cmd_release_news(options, parser, header=None):
         print "  %s" % module
         print "========================================"
         print ""
-        print news[module]
+        print news[module].read()
 
 
 def main():



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]