Author: dmeyer
Date: Thu Mar 20 12:19:30 2008
New Revision: 3211
Log:
add doc
Modified:
trunk/base/src/notifier/async.py
Modified: trunk/base/src/notifier/async.py
==============================================================================
--- trunk/base/src/notifier/async.py (original)
+++ trunk/base/src/notifier/async.py Thu Mar 20 12:19:30 2008
@@ -161,18 +161,34 @@
return s % ("="*n + ">").ljust(width-2)
@property
+ def elapsed(self):
+ """
+ Return time elapsed since the operation started.
+ """
+ return time.time() - self.start_time
+
+ @property
def eta(self):
+ """
+ Estimated time left to complete the operation. Depends on the
+ operation itself if this is correct or not.
+ """
if not self.pos:
return 0
sec = (time.time() - self.start_time) / self.pos
+ # we assume every step takes the same amount of time
return sec * (self.max - self.pos)
@property
def percentage(self):
+ """
+ Return percentage of steps done.
+ """
if self.max:
return (self.pos * 100) / self.max
return 0
-
+
+
def __init__(self):
"""
Create an InProgress object.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog