mglib/mglib/storage.py

34 lines
581 B
Python
Raw Normal View History

import os
2020-05-04 12:35:08 +02:00
class Storage:
"""
2020-05-04 13:58:56 +02:00
Storage class which works with DocumentPath and PagePath
2020-05-04 12:35:08 +02:00
"""
def __init__(self, location=None):
self._location = location
@property
def location(self):
return self._location
2020-05-04 13:58:56 +02:00
def path(self, _path):
return os.path.join(
2020-05-04 13:58:56 +02:00
self.location, _path
)
2020-05-04 13:58:56 +02:00
def delete_document(self, doc_path):
"""
Receives a mglib.path.DocumentPath instance
"""
pass
def exists(self, _path):
return os.path.exists(
self.path(_path)
)
2020-05-04 12:35:08 +02:00