in xar/xar_builder.py [0:0]
def _validate_entry_point(self, entry_point):
"""Validates that the module specified in `entry_point` exists."""
def ensure_exists(module):
basename = os.path.join(self.LIBRARY_PATH, *module.split("."))
if os.path.isdir(self._staging.absolute(basename)):
basename = basename + "/__init__"
for ext in py_util.PYTHON_EXTS:
if self._staging.exists(basename + ext):
return
raise self.InvalidEntryPointError("Module '%s' not found in XAR" % module)
module, function = py_util.parse_entry_point(entry_point)
parent_end = len(module)
while parent_end > 0:
parent_module = module[:parent_end]
ensure_exists(parent_module)
parent_end = parent_module.rfind(".")