def recv_recipe_add(self, environ, start_response): formdata = environ['QUERY_STRING'] results = urlparse.parse_qs(formdata) if ( 'recipe' in results.keys() ): recipeStr = results['recipe'][0] else: recipeStr = '#' data = recipeStr fp = StringIO(data) load_bulk_data.load_recipes(fp) content_type = 'text/html' data = "Added Recipe: %s<p><a href='./'>Index</a>" % recipeStr start_response('200 OK', list(html_headers) ) return [data]
def load_bulk_data_recipes(self,file_name): return load_bulk_data.load_recipes(file_name)
def rpc_recipe_add( self, recipe ): data = recipe fp = StringIO(data) load_bulk_data.load_recipes(fp)