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 > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 03-05-2012, 06:47 PM
"Brian C. Lane"
 
Default update test to use callback

From: "Brian C. Lane" <bcl@redhat.com>

---
testpyisomd5sum.py | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/testpyisomd5sum.py b/testpyisomd5sum.py
index c20f582..7158f78 100755
--- a/testpyisomd5sum.py
+++ b/testpyisomd5sum.py
@@ -18,5 +18,20 @@ print "Implanting again forcing -> ", pyisomd5sum.implantisomd5sum("testiso.iso"
# check it
print "Checking -> ",pyisomd5sum.checkisomd5sum("testiso.iso")

+def callback(offset, total):
+ print "%s - %s" % (offset, total)
+
+print "Run with callback"
+pyisomd5sum.checkisomd5sum("testiso.iso", callback)
+
+def callback_abort(offset, total):
+ print "%s - %s" % (offset, total)
+ if offset > 500000:
+ return True
+ return False
+
+print "Run with callback and abort after offset of 500000"
+pyisomd5sum.checkisomd5sum("testiso.iso", callback_abort)
+
# clean up
os.unlink("testiso.iso")
--
1.7.7.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:55 AM.

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