Browse Source

read write file, small fix

current_wdka_release
crunk 3 years ago
parent
commit
a11a263878
  1. 8
      verse/editor.py

8
verse/editor.py

@ -58,10 +58,12 @@ def SaveUploadCssFile(editorform, newcssfolder):
cssfile = editorform.cssfile.data
cssfilename = f"{secure_filename(editorform.cssname.data)}.css"
cssfile.save(os.path.join(newcssfolder, cssfilename))
openfile = open(os.path.join(newcssfolder, cssfilename), 'r+')
openfile = open(os.path.join(newcssfolder, cssfilename), 'r')
cleancss = bleach.clean(openfile.read())
openfile.write(cleancss)
openfile.close
openfile.close()
cleanfile = open(os.path.join(newcssfolder, cssfilename), 'w')
cleanfile.write(cleancss)
cleanfile.close()
def WriteCssToFile(editorform, newcssfolder):

Loading…
Cancel
Save