MCPcopy Index your code
hub / github.com/kivy/python-for-android / get_recipe

Method get_recipe

pythonforandroid/recipe.py:726–758  ·  view source on GitHub ↗

Returns the Recipe with the given name, if it exists.

(cls, name, ctx)

Source from the content-addressed store, hash-verified

724
725 @classmethod
726 def get_recipe(cls, name, ctx):
727 '''Returns the Recipe with the given name, if it exists.'''
728 name = name.lower()
729 if not hasattr(cls, "recipes"):
730 cls.recipes = {}
731 if name in cls.recipes:
732 return cls.recipes[name]
733
734 recipe_file = None
735 for recipes_dir in cls.recipe_dirs(ctx):
736 if not exists(recipes_dir):
737 continue
738 # Find matching folder (may differ in case):
739 for subfolder in listdir(recipes_dir):
740 if subfolder.lower() == name:
741 recipe_file = join(recipes_dir, subfolder, '__init__.py')
742 if exists(recipe_file):
743 name = subfolder # adapt to actual spelling
744 break
745 recipe_file = None
746 if recipe_file is not None:
747 break
748
749 else:
750 raise ValueError('Recipe does not exist: {}'.format(name))
751
752 mod = import_recipe('pythonforandroid.recipes.{}'.format(name), recipe_file)
753 if len(logger.handlers) > 1:
754 logger.removeHandler(logger.handlers[1])
755 recipe = mod.recipe
756 recipe.ctx = ctx
757 cls.recipes[name.lower()] = recipe
758 return recipe
759
760
761class IncludedFilesBehaviour(object):

Callers 15

_copy_in_final_filesMethod · 0.80
expand_dependenciesFunction · 0.80
has_packageMethod · 0.80
build_recipesFunction · 0.80
process_python_modulesFunction · 0.80
biglinkFunction · 0.80
conflictsMethod · 0.80
obvious_conflict_checkerFunction · 0.80
prebuild_archMethod · 0.80

Calls 2

recipe_dirsMethod · 0.80
formatMethod · 0.80

Tested by 13

test_bootstrap_stripMethod · 0.64
test_save_infoMethod · 0.64
setUpMethod · 0.64
test_get_recipeMethod · 0.64
test_built_librariesMethod · 0.64
test_should_buildMethod · 0.64
setUpMethod · 0.64
test_install_stl_libMethod · 0.64
test_postarch_buildMethod · 0.64