def show_recipe_category_detail(url): items = EffectDetailParser().parse(fetch(url)) for item in items: for attr, value in item.iteritems(): if attr in ('suit_material_list', 'avoid_material_list'): print '%s = ' % (attr,) for material in value: for mattr, mvalue in material.iteritems(): print '%s=%s' % (mattr, mvalue) continue print '%s = %s' % (attr, value) print print
def show_functional_recipe_list(url): items = FunctionalRecipeListParser().parse(fetch(url)) for item in items: for attr, value in item.iteritems(): print '%s = %s' % (attr, value) print
def show_bake_category_list(url): items = BakeCategoryListParser().parse(fetch(url)) for item in items: for attr, value in item.iteritems(): print '%s = %s' % (attr, value) print
def show_regionsnacks_category_list(url): items = RegionSnacksCategoryListParser().parse(fetch(url)) for item in items: for attr, value in item.iteritems(): print '%s = %s' % (attr, value) print
def show_foreignrecipe_category_list(url): items = ForeignRecipeCategoryListParser().parse(fetch(url)) for item in items: for attr, value in item.iteritems(): print '%s = %s' % (attr, value) print
def show_material_list(url): items = MaterialListParser().parse(fetch(url)) for item in items: for attr, value in item.iteritems(): print '%s=%s' % (attr, value) print
def show_food_recipe(url): item, = FoodRecipeParser().parse(fetch(url)) for attr, value in item.iteritems(): print '%s=%s' % (attr, value) print
def show_food_material(name): url = 'http://www.meishij.net/%s' % (name,) item, = FoodMaterialParser().parse(fetch(url)) for attr, value in item.iteritems(): print '%s=%s' % (attr, value) print
def show_hack(): url = 'http://www.meishij.net/hack/hack.php' item, = HackParser().parse(fetch(url)) for attr, value in item.iteritems(): print '%s=%s' % (attr, value) print
def test_food_material(self, food_material_parser, url, expected): response = fetch(url) for item in food_material_parser.parse(response): for attr, value in expected.iteritems(): assert item[attr] == value