Skip to content
__init__.py 25 KiB
Newer Older
        self.LastUpdate = now

    def progress(self, steps=1):
        self.set_progress(self.Done + steps)

    def set_progress(self, done):
        self.Done = done
        self.draw()

    def finished(self):
        import sys
        self.set_progress(self.Total)
        sys.stderr.write("\n")




# file system related ---------------------------------------------------------
def assert_not_a_file(name):
    import os
    if os.access(name, os.F_OK):
        raise IOError, "file `%s' already exists" % name
    

def _test():
    import doctest
    doctest.testmod()

if __name__ == "__main__":
    _test()