当前位置: 首页>>代码示例>>Python>>正文


Python Recipe.list_recipes方法代码示例

本文整理汇总了Python中pythonforandroid.recipe.Recipe.list_recipes方法的典型用法代码示例。如果您正苦于以下问题:Python Recipe.list_recipes方法的具体用法?Python Recipe.list_recipes怎么用?Python Recipe.list_recipes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pythonforandroid.recipe.Recipe的用法示例。


在下文中一共展示了Recipe.list_recipes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: recipes

# 需要导入模块: from pythonforandroid.recipe import Recipe [as 别名]
# 或者: from pythonforandroid.recipe.Recipe import list_recipes [as 别名]
    def recipes(self, args):
        parser = argparse.ArgumentParser(
                description="List all the available recipes")
        parser.add_argument(
                "--compact", action="store_true", default=False,
                help="Produce a compact list suitable for scripting")

        args = parser.parse_args(args)

        ctx = self.ctx
        if args.compact:
            print(" ".join(set(Recipe.list_recipes(ctx))))
        else:
            for name in sorted(Recipe.list_recipes(ctx)):
                recipe = Recipe.get_recipe(name, ctx)
                version = str(recipe.version)
                print('{Fore.BLUE}{Style.BRIGHT}{recipe.name:<12} '
                      '{Style.RESET_ALL}{Fore.LIGHTBLUE_EX}'
                      '{version:<8}{Style.RESET_ALL}'.format(
                        recipe=recipe, Fore=Out_Fore, Style=Out_Style,
                        version=version))
                print('    {Fore.GREEN}depends: {recipe.depends}'
                      '{Fore.RESET}'.format(recipe=recipe, Fore=Out_Fore))
                if recipe.conflicts:
                    print('    {Fore.RED}conflicts: {recipe.conflicts}'
                          '{Fore.RESET}'
                          .format(recipe=recipe, Fore=Out_Fore))
                if recipe.opt_depends:
                    print('    {Fore.YELLOW}optional depends: '
                          '{recipe.opt_depends}{Fore.RESET}'
                          .format(recipe=recipe, Fore=Out_Fore))
开发者ID:ed00m,项目名称:python-for-android,代码行数:33,代码来源:toolchain.py

示例2: recipes

# 需要导入模块: from pythonforandroid.recipe import Recipe [as 别名]
# 或者: from pythonforandroid.recipe.Recipe import list_recipes [as 别名]
 def recipes(self, args):
     ctx = self.ctx
     if args.compact:
         print(" ".join(set(Recipe.list_recipes(ctx))))
     else:
         for name in sorted(Recipe.list_recipes(ctx)):
             try:
                 recipe = Recipe.get_recipe(name, ctx)
             except IOError:
                 warning('Recipe "{}" could not be loaded'.format(name))
             except SyntaxError:
                 import traceback
                 traceback.print_exc()
                 warning(('Recipe "{}" could not be loaded due to a '
                          'syntax error').format(name))
             version = str(recipe.version)
             print('{Fore.BLUE}{Style.BRIGHT}{recipe.name:<12} '
                   '{Style.RESET_ALL}{Fore.LIGHTBLUE_EX}'
                   '{version:<8}{Style.RESET_ALL}'.format(
                     recipe=recipe, Fore=Out_Fore, Style=Out_Style,
                     version=version))
             print('    {Fore.GREEN}depends: {recipe.depends}'
                   '{Fore.RESET}'.format(recipe=recipe, Fore=Out_Fore))
             if recipe.conflicts:
                 print('    {Fore.RED}conflicts: {recipe.conflicts}'
                       '{Fore.RESET}'
                       .format(recipe=recipe, Fore=Out_Fore))
             if recipe.opt_depends:
                 print('    {Fore.YELLOW}optional depends: '
                       '{recipe.opt_depends}{Fore.RESET}'
                       .format(recipe=recipe, Fore=Out_Fore))
开发者ID:yileye,项目名称:python-for-android,代码行数:33,代码来源:toolchain.py

示例3: test_list_recipes

# 需要导入模块: from pythonforandroid.recipe import Recipe [as 别名]
# 或者: from pythonforandroid.recipe.Recipe import list_recipes [as 别名]
 def test_list_recipes(self):
     """
     Trivial test verifying list_recipes returns a generator with some recipes.
     """
     ctx = Context()
     recipes = Recipe.list_recipes(ctx)
     self.assertTrue(isinstance(recipes, types.GeneratorType))
     recipes = list(recipes)
     self.assertIn('python3', recipes)
开发者ID:PKRoma,项目名称:python-for-android,代码行数:11,代码来源:test_recipe.py

示例4: recipes

# 需要导入模块: from pythonforandroid.recipe import Recipe [as 别名]
# 或者: from pythonforandroid.recipe.Recipe import list_recipes [as 别名]
 def recipes(self, args):
     ctx = self.ctx
     if args.compact:
         print(" ".join(set(Recipe.list_recipes(ctx))))
     else:
         for name in sorted(Recipe.list_recipes(ctx)):
             recipe = Recipe.get_recipe(name, ctx)
             version = str(recipe.version)
             print('{Fore.BLUE}{Style.BRIGHT}{recipe.name:<12} '
                   '{Style.RESET_ALL}{Fore.LIGHTBLUE_EX}'
                   '{version:<8}{Style.RESET_ALL}'.format(
                     recipe=recipe, Fore=Out_Fore, Style=Out_Style,
                     version=version))
             print('    {Fore.GREEN}depends: {recipe.depends}'
                   '{Fore.RESET}'.format(recipe=recipe, Fore=Out_Fore))
             if recipe.conflicts:
                 print('    {Fore.RED}conflicts: {recipe.conflicts}'
                       '{Fore.RESET}'
                       .format(recipe=recipe, Fore=Out_Fore))
             if recipe.opt_depends:
                 print('    {Fore.YELLOW}optional depends: '
                       '{recipe.opt_depends}{Fore.RESET}'
                       .format(recipe=recipe, Fore=Out_Fore))
开发者ID:Xceasar,项目名称:python-for-android,代码行数:25,代码来源:toolchain.py


注:本文中的pythonforandroid.recipe.Recipe.list_recipes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。