Exemplo n.º 1
0
 def setup_db (self):
     print 'rm.dbargs[file]=',rm.dbargs['file']
     self.db = rm.RecipeManager(**rm.dbargs)
     if self.db.fetch_len(self.db.recipe_table)==0:
         raise Exception("No recipes in database.")
     self.mult_export_args = {'rd':self.db,
                              'rv':self.db.fetch_all(self.db.recipe_table),
                              'conv':None,
                              'prog':None,
                              'extra_prefs':{}
                              }
Exemplo n.º 2
0
               "sliced",
               "chopped",
               "diced",
               "pureed",
               "blended",
               "grated",
               "minced",
               "cored",
               "heated",
               "warmed",
               "chilled"]

def get_keymanager (*args, **kwargs):
    try:
        return KeyManager(*args,**kwargs)
    except KeyManager, km:
        return km

if __name__ == '__main__':

    def timef (f):
        t = time.time()
        f()
        print time.time()-t
    import tempfile
    import recipeManager
    km = KeyManager(rm=recipeManager.RecipeManager(**recipeManager.dbargs))
    recipeManager.dbargs['file']=tempfile.mktemp('.mk')
    fkm = KeyManager(rm=recipeManager.RecipeManager(**recipeManager.dbargs))

Exemplo n.º 3
0
 def __init__ (self):
     rm.dbargs['file']=tempfile.mktemp('test.db')
     self.db = rm.RecipeManager(**rm.dbargs)