Source code for ohsnap.archive
#!/usr/bin/env python
[docs]class Archive():
"""A class to represent ohsnap formatted tarsnap archives"""
def __init__(self, full_name):
"""Initialize the object by splitting the full tarsnap archive name into
the creation time, retention, and ohsnap name"""
self.prefix, self.time, self.retention, self.name = full_name.split(':', 3)
[docs] def time_string(self):
"""Return a human readable time string from the internal Unix style
time"""
return time.strftime("%b %d %Y %H:%M:%S",
time.localtime(float(self.time)))
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4