INNER CODE UNIT · Python
auto_find_instance_path
michaelzhang-ai/Text2Video · venv_vid2vid/lib/python3.7/site-packages/flask/app.py:717
def auto_find_instance_path(self):
"""Tries to locate the instance path if it was not provided to the
constructor of the application class. It will basically calculate
the path to a folder named ``instance`` next to your main file or
the package.
.. versionadded:: 0.8
"""
prefix, package_path = find_package(self.import_name)
if prefix is None:
return os.path.join(package_path, "instance")
return os.path.join(prefix, "var", self.name + "-instance")
def open_instance_resource(self, resource, mode="rb"):
"""Opens a resource from the application's instance folder
(:attr:`instance_path`). Otherwise works like
:meth:`open_resource`. Instance resources can also be opened for
writing.