From c3844d11026f84400d5a088dd5c24c6a4a04dcd1 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 10 Aug 2011 23:21:43 +0200 Subject: [PATCH] Rename _get_package_path to get_root_path to avoid confusion --- flask/helpers.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/flask/helpers.py b/flask/helpers.py index d3ce50b8..04d23a07 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -466,8 +466,12 @@ def send_from_directory(directory, filename, **options): return send_file(filename, conditional=True, **options) -def get_package_path(name): - """Returns the path to a package or cwd if that cannot be found.""" +def get_root_path(name): + """Returns the path to a package or cwd if that cannot be found. This + returns the path of a package or the folder that contains a module. + + Not to be confused with the package path returned by :func:`find_package`. + """ try: return os.path.abspath(os.path.dirname(sys.modules[name].__file__)) except (KeyError, AttributeError): @@ -549,7 +553,7 @@ class _PackageBoundObject(object): self.template_folder = template_folder #: Where is the app root located? - self.root_path = get_package_path(self.import_name) + self.root_path = get_root_path(self.import_name) self._static_folder = None self._static_url_path = None