create file if missing

This commit is contained in:
q
2016-07-04 20:35:07 +03:00
parent 448f645f17
commit 5b1d2ce232

View File

@@ -119,6 +119,8 @@ def show_shop(shopid):
return redirect(url_for('list_shops'))
data_dir=os.path.join(DATADIR, get_username(row[2]))
data_file=os.path.join(data_dir, row[1]+".md")
if not os.path.exists(data_file):
open(data_file, 'wt').close()
entries=[]
content=open(data_file, 'rt').read().decode('utf-8')
for i,row in enumerate(open( data_file, 'rt').read().decode('utf-8').split("\n")):