default recipe instruction
337883
function defaultInstructions (format) {
  // start with empty instructions
  let instructions = emptyInstructions('_defaults', format);

  // extend with the default recipe, if it exists for the target extension
  const recipeFilePath = path.join(
    __dirname,
    '..',
    '_defaults',
    `recipe.${format}.json`
  );
  if (fs.existsSync(recipeFilePath)) {
    instructions = Object.assign(
      instructions,
      JSON.parse(fs.readFileSync(recipeFilePath, 'utf8'))
    );
  }
  return instructions;
}
214899
def run(self):
        

        self._prepare()

        for recipe in self._recipes:
            run_recipe = True

            # Ask user whether to run current recipe if -y argument is not specified
            if not self.arguments.yes:
                run_recipe = pypro.console.ask_bool('Run %s.%s' % (recipe.module, recipe.name), "yes")

            if run_recipe:
                recipe.run(self, self.arguments)

        if self.arguments.verbose:
            pypro.console.out('Thanks for using pypro. Support this project at https://github.com/avladev/pypro')
909982
def recipe_compile(backend, kitchen, recipe, variation):
    
    err_str, use_kitchen = Backend.get_kitchen_from_user(kitchen)
    if use_kitchen is None:
        raise click.ClickException(err_str)

    if recipe is None:
        recipe = DKRecipeDisk.find_recipe_name()
        if recipe is None:
            raise click.ClickException('You must be in a recipe folder, or provide a recipe name.')

    click.secho('%s - Get the Compiled OrderRun of Recipe %s.%s in Kitchen %s' % (get_datetime(), recipe, variation, use_kitchen),
                fg='green')
    check_and_print(DKCloudCommandRunner.get_compiled_serving(backend.dki, use_kitchen, recipe, variation))
1304728
def get_recipe_env(self, arch=None, with_flags_in_cc=True, clang=False):
        
        if arch is None:
            arch = self.filtered_archs[0]
        return arch.get_env(with_flags_in_cc=with_flags_in_cc, clang=clang)
284254
def _default(cls, opts):
        """"""
        level = getattr(logging, opts.log_level, logging.DEBUG)

        logger = logging.getLogger('luigi-interface')
        logger.setLevel(level)

        stream_handler = logging.StreamHandler()
        stream_handler.setLevel(level)

        formatter = logging.Formatter('%(levelname)s: %(message)s')
        stream_handler.setFormatter(formatter)

        logger.addHandler(stream_handler)
        return True
446787
def default(self, line):
        """"""
        args = self._split_args(line, 0, 99)
        d1_cli.impl.util.print_error("Unknown command: {}".format(args[0]))
208321
def set_libs_flags(self, env, arch):
        '''
        '''
        def add_flags(include_flags, link_dirs, link_libs):
            env['CPPFLAGS'] = env.get('CPPFLAGS', '') + include_flags
            env['LDFLAGS'] = env.get('LDFLAGS', '') + link_dirs
            env['LIBS'] = env.get('LIBS', '') + link_libs

        if 'sqlite3' in self.ctx.recipe_build_order:
            info('Activating flags for sqlite3')
            recipe = Recipe.get_recipe('sqlite3', self.ctx)
            add_flags(' -I' + recipe.get_build_dir(arch.arch),
                      ' -L' + recipe.get_lib_dir(arch), ' -lsqlite3')

        if 'libffi' in self.ctx.recipe_build_order:
            info('Activating flags for libffi')
            recipe = Recipe.get_recipe('libffi', self.ctx)
            # In order to force the correct linkage for our libffi library, we
            # set the following variable to point where is our libffi.pc file,
            # because the python build system uses pkg-config to configure it.
            env['PKG_CONFIG_PATH'] = recipe.get_build_dir(arch.arch)
            add_flags(' -I' + ' -I'.join(recipe.get_include_dirs(arch)),
                      ' -L' + join(recipe.get_build_dir(arch.arch), '.libs'),
                      ' -lffi')

        if 'openssl' in self.ctx.recipe_build_order:
            info('Activating flags for openssl')
            recipe = Recipe.get_recipe('openssl', self.ctx)
            add_flags(recipe.include_flags(arch),
                      recipe.link_dirs_flags(arch), recipe.link_libs_flags())
        return env
1019210
def recipe(recipe):
    
    env.host_string = lib.get_env_host_string()
    lib.print_header(
        "Applying recipe '{0}' on node {1}".format(recipe, env.host_string))

    # Create configuration and sync node
    data = lib.get_node(env.host_string)
    data["run_list"] = ["recipe[{0}]".format(recipe)]
    if not __testing__:
        if env.autodeploy_chef and not chef.chef_test():
            deploy_chef(ask="no")
        chef.sync_node(data)
387555
def print_recipe(recipe):
    """"""
    print(colors.yellow("\n{0}".format(recipe['name'])))
    print "  description:  {0}".format(recipe['description'])
    print "  version:      {0}".format(recipe['version'])
    print "  dependencies: {0}".format(", ".join(recipe['dependencies']))
    print "  attributes:   {0}".format(", ".join(recipe['attributes']))
775630
def find_recipe(cookbook, recipe_name = nil)
      recipes = cookbook.recipe_filenames_by_name
      if recipe_name.nil?
        default_recipe = recipes["default"]
        raise NoDefaultRecipe.new(cookbook.root_dir, cookbook.name) if default_recipe.nil?
        default_recipe
      else
        recipe = recipes[recipe_name]
        raise RecipeNotFound.new(cookbook.root_dir, recipe_name, recipes.keys, cookbook.name) if recipe.nil?
        recipe
      end
    end
288689
def order_run(backend, kitchen, recipe, variation, node):
    
    err_str, use_kitchen = Backend.get_kitchen_from_user(kitchen)
    if use_kitchen is None:
        raise click.ClickException(err_str)
    if recipe is None:
        recipe = DKRecipeDisk.find_recipe_name()
        if recipe is None:
            raise click.ClickException('You must be in a recipe folder, or provide a recipe name.')

    msg = '%s - Create an Order:\n\tKitchen: %s\n\tRecipe: %s\n\tVariation: %s\n' % (get_datetime(), use_kitchen, recipe, variation)
    if node is not None:
        msg += '\tNode: %s\n' % node

    click.secho(msg, fg='green')
    check_and_print(DKCloudCommandRunner.create_order(backend.dki, use_kitchen, recipe, variation, node))
956282
def get_recipe_object(self, mode_name, pipeline_name='default'):
        """"""
        active_mode = self.modes[mode_name]
        active_pipeline = self.pipelines[pipeline_name]
        recipe = active_pipeline.get_recipe_object(active_mode)
        return recipe
940893
function initMenu() {
    let menuCfg = defaults.menu;

    // no configuration given and neither the menu created earlier
    // no need to proceed
    if (!menuCfg && !Menu.created) {
        return;
    }

    // set options to create menu
    if (menuCfg) {
        Menu.setOptions(menuCfg);
    }

    menuDoc = Menu.get();
    Page.prepareDom(menuDoc);
}
741104
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
        
        env = super(GeventRecipe, self).get_recipe_env(arch, with_flags_in_cc)
        # CFLAGS may only be used to specify C compiler flags, for macro definitions use CPPFLAGS
        regex = re.compile(r'(?:\s|^)-[DI][\S]+')
        env['CPPFLAGS'] = ''.join(re.findall(regex, env['CFLAGS'])).strip()
        env['CFLAGS'] = re.sub(regex, '', env['CFLAGS'])
        info('Moved "{}" from CFLAGS to CPPFLAGS.'.format(env['CPPFLAGS']))
        # LDFLAGS may only be used to specify linker flags, for libraries use LIBS
        regex = re.compile(r'(?:\s|^)-l[\w\.]+')
        env['LIBS'] = ''.join(re.findall(regex, env['LDFLAGS'])).strip()
        env['LDFLAGS'] = re.sub(regex, '', env['LDFLAGS'])
        info('Moved "{}" from LDFLAGS to LIBS.'.format(env['LIBS']))
        return env
383838
def set_default(cls, rules):
    """"""
    if not isinstance(rules, JarRules):
      raise ValueError('The default rules must be a JarRules instance.')
    cls._DEFAULT = rules
488507
def main(argv=None):
    

    if argv is None:
        argv = sys.argv[1:]

    parser = build_args()
    args = parser.parse_args(args=argv)

    recipe_name, _ext = os.path.splitext(os.path.basename(args.recipe))

    rm = RecipeManager()
    rm.add_recipe_folder(os.path.dirname(args.recipe), whitelist=[os.path.basename(args.recipe)])
    recipe = rm.get_recipe(recipe_name)

    if args.archive is not None:
        print("Archiving recipe into %s" % args.archive)
        recipe.archive(args.archive)
        return 0

    if args.info:
        print(recipe)
        return 0

    variables = load_variables(args.define, args.config)

    success = 0

    start_time = time.time()

    if args.loop is None:
        try:
            recipe.run(variables)
            success += 1
        except IOTileException as exc:
            print("Error running recipe: %s" % str(exc))
            return 1
    else:
        while True:
            value = input("Enter value for loop variable %s (return to stop): " % args.loop)

            if value == '':
                break

            local_vars = dict(**variables)
            local_vars[args.loop] = value

            try:
                recipe.run(local_vars)
                success += 1
            except IOTileException as exc:
                print("--> ERROR processing loop variable %s: %s" % (value, str(exc)))

    end_time = time.time()
    total_time = end_time - start_time

    if success == 0:
        per_time = 0.0
    else:
        per_time = total_time / success

    print("Performed %d runs in %.1f seconds (%.1f seconds / run)" % (success, total_time, per_time))
    return 0
206390
def load_recipe(self, recipe):
    
    self.recipe = recipe
    for module_description in recipe['modules']:
      # Combine CLI args with args from the recipe description
      module_name = module_description['name']
      module = self.config.get_module(module_name)(self)
      self._module_pool[module_name] = module