minor changes.

This commit is contained in:
= 2022-06-05 21:40:59 +05:30
parent 40870fd759
commit 01bf86d086
1 changed files with 6 additions and 2 deletions

View File

@ -449,8 +449,12 @@ elif (arg == "post"):
existing_files = listdir(f"{postDir}")
while True: # inputting custom filename from user, or not. if empty, simply set fname to None, which makes newpost() know to generate filename using the sha1 hash
fname = input("\nFILENAME: (without .gmi extension) (no spaces. leave empty to generate random) ")
if (fname[-1] == '\n'): # removing the \n that creeps in because of input()
fname = fname[:-1]
try:
if (fname[-1] == '\n'): # removing the \n that creeps in because of input()
fname = fname[:-1]
except IndexError:
fname = ''
if ".gmi" in fname:
prYellow("The filename should not contain .gmi extension because it is automatically added.\n Correcting and continuing...")