improve CLI output

This commit is contained in:
2021-09-30 23:51:06 +02:00
parent 01ae131088
commit 6a242e7d02
4 changed files with 27 additions and 3 deletions

View File

@@ -47,6 +47,10 @@ class BaseMailStorage:
self.metavar = metavar
self.pretend = False
@property
def type(self):
return "Base"
def add(self, data, qid, mailfrom, recipients, subject, variables):
"Add email to storage."
return ("", "")
@@ -103,6 +107,10 @@ class FileMailStorage(BaseMailStorage):
cfg.append(f"original={self.original}")
return "FileMailStorage(" + ", ".join(cfg) + ")"
@property
def type(self):
return "File"
def get_storageid(self, qid):
timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
return f"{timestamp}_{qid}"