def __init__(self, path, name): self.path = path f = open(path, 'rb') data = f.read() f.close() self.content_type, enc = guess_content_type(path, data) self.__name__ = name self.lmt = float(os.path.getmtime(path)) or time() self.lmh = rfc1123_date(self.lmt)
def testrfc1123_date(self): from zope.app.datetimeutils import rfc1123_date self.assertEqual(rfc1123_date(time("2002-01-12T01:01:01.234Z")), "Sat, 12 Jan 2002 01:01:01 GMT")