Files
pillar/pillar/web/staticfile.py
Sybren A. Stüvel e0c525389f Renamed static.py to staticfile.py
Python 3 supports 'namespace packages', and thus can see a directory
without __init__.py as something importable. This caused a name conflict,
since there were both the file static.py and the dir static.
2017-03-22 15:49:51 +01:00

13 lines
293 B
Python

"""Static file handling"""
import flask
import flask.views
class PillarStaticFile(flask.views.MethodView):
def __init__(self, static_folder):
self.static_folder = static_folder
def get(self, filename):
return flask.send_from_directory(self.static_folder, filename)