mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
use 'with' construct to open file
This commit is contained in:
parent
d4ad036ff0
commit
243ed3f64b
@ -83,7 +83,6 @@ class View(PagePlugin):
|
||||
if page not in ['design', 'plinth', 'hacking', 'faq']:
|
||||
raise cherrypy.HTTPError(404, "The path '/help/view/%s' was not found." % page)
|
||||
return self.fill_template(template="err", main="<p>Sorry, as much as I would like to show you that page, I don't seem to have a page named %s!</p>" % page)
|
||||
IF = open(os.path.join("doc", "%s.part.html" % page), 'r')
|
||||
main = IF.read()
|
||||
IF.close()
|
||||
return self.fill_template(template="two_col", title=_("%s Documentation" % cfg.product_name), main=main)
|
||||
with open(os.path.join("doc", "%s.part.html" % page), 'r') as IF:
|
||||
main = IF.read()
|
||||
return self.fill_template(title=_("%s Documentation" % cfg.product_name), main=main)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user