forked from crunk/distribusi-verse
pep8 remove warnings
This commit is contained in:
parent
8214b714ba
commit
f44778dde1
@ -81,7 +81,7 @@ def index():
|
||||
"term": distribusi.term,
|
||||
"course": distribusi.course,
|
||||
"year": distribusi.year,
|
||||
"tags": distribusi.tags.split(','),
|
||||
"tags": distribusi.tags.split(","),
|
||||
}
|
||||
distribusies[distribusi.distribusiname] = singledistribusi
|
||||
years = uploadform.academicyear.choices
|
||||
@ -130,7 +130,9 @@ def distribusi():
|
||||
os.remove(os.path.join(userfolder, zipfilename))
|
||||
# To Do: Make sure nothing can be executed from the upload folder
|
||||
cssfile = ""
|
||||
cssfolder = os.path.join("themes/userstyles", distribusi.distribusiname)
|
||||
cssfolder = os.path.join(
|
||||
"themes/userstyles", distribusi.distribusiname
|
||||
)
|
||||
for filename in os.listdir(cssfolder):
|
||||
if filename.endswith(".css"):
|
||||
cssfile = os.path.join(cssfolder, filename)
|
||||
@ -164,11 +166,9 @@ def upload():
|
||||
themeform = ThemeForm()
|
||||
selectorform = SelectorForm()
|
||||
selectorform.distribusis.choices = distribusisfields()
|
||||
|
||||
selectorvisible = SelectorVisible()
|
||||
|
||||
current_distribusi = CurrentDistribusi()
|
||||
if current_distribusi == "new" or HasDistribusi() == False:
|
||||
if current_distribusi == "new" or HasDistribusi() is False:
|
||||
uploadform = UploadNewDistribusi(APP.config["UPLOAD_FOLDER"])
|
||||
else:
|
||||
uploadform = UploadUpdatedFiles(APP.config["UPLOAD_FOLDER"])
|
||||
@ -238,19 +238,19 @@ def editor():
|
||||
files_uploaded = IsZipUploaded(current_distribusi)
|
||||
distribusi_live = IsDistribusiLive(current_distribusi)
|
||||
cssplaceholder = "Try out your CSS here"
|
||||
with open('themes/editor/placeholder.css') as f:
|
||||
with open("themes/editor/placeholder.css") as f:
|
||||
cssplaceholder = f.read()
|
||||
editorform.css.data = cssplaceholder
|
||||
|
||||
htmlplaceholder = "Write some test HTML here"
|
||||
with open('themes/editor/placeholder.html') as f:
|
||||
with open("themes/editor/placeholder.html") as f:
|
||||
htmlplaceholder = f.read()
|
||||
print(htmlplaceholder)
|
||||
if editorform.validate_on_submit():
|
||||
userfolder = os.path.join("themes/userstyles", current_distribusi)
|
||||
os.mkdir(newuserfolder)
|
||||
cssfolder = os.path.join("themes/userstyles", current_distribusi)
|
||||
os.mkdir(cssfolder)
|
||||
cssfilename = "{}.css".format(editorform.cssname.data)
|
||||
with open(os.path.join(userfolder, cssfilename), "w") as cssfile:
|
||||
with open(os.path.join(cssfolder, cssfilename), "w") as cssfile:
|
||||
cssfile.write(editorform.css.data)
|
||||
cssfile.close
|
||||
|
||||
|
@ -82,7 +82,6 @@ def SelectCurrentDistribusi(distribusiname):
|
||||
db.session.commit()
|
||||
except:
|
||||
db.session.rollback()
|
||||
selectorform.distribusis.errors.append("Unknown error occured!")
|
||||
flash("An error occured !", "danger")
|
||||
|
||||
|
||||
|
@ -16,7 +16,6 @@ from statuspengguna.helper import SelectCurrentDistribusi
|
||||
from forms.uploadform import UploadForm
|
||||
|
||||
|
||||
|
||||
def UploadNewDistribusi(uploadfolder):
|
||||
uploadform = UploadForm()
|
||||
if uploadform.validate_on_submit():
|
||||
|
Loading…
Reference in New Issue
Block a user