first commit
This commit is contained in:
24
functions/backupType.py
Normal file
24
functions/backupType.py
Normal file
@@ -0,0 +1,24 @@
|
||||
def get_backup_extension():
|
||||
backup_type = input("Enter backup type (md, pdf, html, text): ").strip().lower()
|
||||
if backup_type in ["md", "markdown"]:
|
||||
return "markdown"
|
||||
elif backup_type == "pdf":
|
||||
return "PDF"
|
||||
elif backup_type == "html":
|
||||
return "HTML"
|
||||
elif backup_type in ["plain", "text", "txt", "plain_text"]:
|
||||
return "Plaintext"
|
||||
else:
|
||||
raise ValueError("Unsupported backup type")
|
||||
|
||||
def set_backup_extension_filetype(backup_type):
|
||||
if backup_type == "markdown":
|
||||
return ".md"
|
||||
elif backup_type == "PDF":
|
||||
return ".pdf"
|
||||
elif backup_type == "HTML":
|
||||
return ".html"
|
||||
elif backup_type == "Plaintext":
|
||||
return ".txt"
|
||||
else:
|
||||
print("Error file type not found")
|
||||
Reference in New Issue
Block a user