[PATCH 2/2] update test to use callback

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

 



From: "Brian C. Lane" <bcl@xxxxxxxxxx>

---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux