Skip to content
Myr

Updated docstring

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent c3844d1 · Browse files · 1 file+10 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−4 removed

  • other:+10 added−4 removed

1 file+10 added−4 removed

modified:flask/helpers.py+10 added-4 removed
464 unmodified lines
465 raise NotFound()466 return send_file(filename, conditional=True, **options)467468469def get_root_path(name):469def get_root_path(import_name):470 """Returns the path to a package or cwd if that cannot be found. This471 returns the path of a package or the folder that contains a module.472473 Not to be confused with the package path returned by :func:`find_package`.474 """475 __import__(import_name)476 try:476 return os.path.abspath(os.path.dirname(sys.modules[name].__file__))477 except (KeyError, AttributeError):477 directory = os.path.dirname(sys.modules[import_name].__file__)478 return os.path.abspath(directory)479 except AttributeError:480 return os.getcwd()481482483def find_package(import_name):484 """Finds a package and returns the prefix (or None if the package is485 not installed) as well as the folder that contains the package or484 module as a tuple.486 module as a tuple. The package path returned is the module that would487 have to be added to the pythonpath in order to make it possible to488 import the module. The prefix is the path below which a UNIX like489 folder structure exists (lib, share etc.).490 """491 __import__(import_name)492 root_mod = sys.modules[import_name.split('.')[0]]493 package_path = getattr(root_mod, '__file__', None)494 if package_path is None:495 package_path = os.getcwd()
144 unmodified lines