From 2e307a1d2489f1357f896f485f30edd9dc9da048 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Thu, 20 Oct 2016 09:21:32 -0400 Subject: [PATCH] Add _is_package --- vladiate/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vladiate/main.py b/vladiate/main.py index 7f4bc2a..462a412 100644 --- a/vladiate/main.py +++ b/vladiate/main.py @@ -71,6 +71,16 @@ def is_vlad(tup): hasattr(item, "validators") and not name.startswith('_')) +def _is_package(path): + """ + Is the given path a Python package? + """ + return ( + os.path.isdir(path) + and os.path.exists(os.path.join(path, '__init__.py')) + ) + + def find_vladfile(vladfile, path='.'): """ Attempt to locate a vladfile, either explicitly or by searching parent dirs.