Exemplo n.º 1
0
                        if rawrec == False:
                            log.info( "running recipe: '%s'\n" % rec)

                        # logic to handle:
                        #  * recipes in config path somewhere
                        #  * filenames
                        #  * which need compiling due to arguments
                        if (os.path.exists(rec)):
                            if "recipe." not in rec:
                                raise "Recipe files must be named 'recipe.RECIPENAME'"
                            else:
                                rname = re.sub("recipe.", "", os.path.basename(rec))
                            rf = open(rec)
                            rsrc = rf.read()
                            prec = rl.compose_recipe(rname, rsrc)
                            rfunc = rl.compile_recipe(rname, prec)
                            ro = rl.bind_recipe(ro, rname, rfunc)
                            rec = rname
                        elif "(" in rec:
                            # print "r819:", rec
                            rsrc = rec
                            rname = "userCommand%d" % cmdnum
                            prec = rl.compose_recipe(rname, rsrc)
                            # log.debug(prec)
                            rfunc = rl.compile_recipe(rname, prec)
                            ro = rl.bind_recipe(ro, rname, rfunc)
                            rec = rname
                        else:
                            if args.astrotype:
                                rl.load_and_bind_recipe(ro, rec, astrotype=args.astrotype)