(self, file)
| 1585 | |
| 1586 | class LocalFileClass: |
| 1587 | def __init__(self, file): |
| 1588 | self.file = file |
| 1589 | self.path = data_root / "local" / file |
| 1590 | if os.path.exists(self.path): |
| 1591 | self.ctime = time.strftime( |
| 1592 | "%Y-%m-%d %H:%M:%S", time.localtime(os.path.getctime(self.path)) |
| 1593 | ) |
| 1594 | self.size = os.path.getsize(self.path) |
| 1595 | else: |
| 1596 | self.ctime = None |
| 1597 | self.size = None |
| 1598 | |
| 1599 | async def read(self): |
| 1600 | return open(self.path, "rb") |