Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
???????? ?????? ???????
    

        def delete_recipe_version(recipe_id, recipe_version):
    """ ???????? ?????? ???????
    """
    versions = json.load(open(os.path.join(settings.RECIPES_PATH, recipe_id, 'about.json'), 'r'))
    file_name = 'v' + str(recipe_version) + '.xml'
    new_versions = [x for x in versions if x['file'] != file_name]
    json.dump(new_versions, open(os.path.join(settings.RECIPES_PATH, recipe_id, 'about.json'), 'w'))
    os.remove(os.path.join(settings.RECIPES_PATH, recipe_id, file_name))
        


src/j/u/junta-0.2.22/server/views.py   junta(Download)
    from backend.servertoagent import installation_request, exit_request
    from backend.server import start_server
    from backend.recipes import get_recipes, get_recipe_template, get_next_version, \
                        not_valid_error_message, create_recipe_path_if_not_exists, recipe_save, get_recipe_content, \
                        get_last_version, get_default_config, delete_recipe_version, recipe_delete, get_version_count
                return HttpResponseRedirect("/recipes")
            else:
                delete_recipe_version(recipe_id, recipe_version)
                c = get_common_context(request)
                last_version = get_last_version(recipe_id, c['recipes'])