Ejemplo n.º 1
0
        def update_abstraction(old_obj, trans_dict):
            def get_version(old_obj, trans_dict):
                return long(old_obj.db_internal_version)

            new_dict = {'DBAbstractionRef': {'version': get_version}}
            new_dict.update(trans_dict)
            return DBAbstractionRef.update_version(old_obj.db_data, new_dict)
Ejemplo n.º 2
0
        def update_abstraction(old_obj, trans_dict):
            def get_version(old_obj, trans_dict):
                return long(old_obj.db_internal_version)

            new_dict = {"DBAbstractionRef": {"version": get_version}}
            new_dict.update(trans_dict)
            return DBAbstractionRef.update_version(old_obj.db_data, new_dict)
Ejemplo n.º 3
0
def convert_data(child):
    if child.vtType == 'module':
        return DBModule(id=child.db_id,
                        cache=child.db_cache,
                        name=child.db_name,
                        namespace=child.db_namespace,
                        package=child.db_package,
                        version=child.db_version,
                        tag=child.db_tag)
    elif child.vtType == 'abstractionRef':
        return DBAbstractionRef(id=child.db_id,
                                name=child.db_name,
                                cache=child.db_cache,
                                abstraction_id=child.db_abstraction_id,
                                version=child.db_version)
    elif child.vtType == 'connection':
        return DBConnection(id=child.db_id)
    elif child.vtType == 'portSpec':
        return DBPortSpec(id=child.db_id,
                          name=child.db_name,
                          type=child.db_type,
                          spec=child.db_spec)
    elif child.vtType == 'function':
        return DBFunction(id=child.db_id,
                          pos=child.db_pos,
                          name=child.db_name)
    elif child.vtType == 'parameter':
        return DBParameter(id=child.db_id,
                           pos=child.db_pos,
                           name=child.db_name,
                           type=child.db_type,
                           val=child.db_val,
                           alias=child.db_alias)
    elif child.vtType == 'location':
        return DBLocation(id=child.db_id,
                          x=child.db_x,
                          y=child.db_y)
    elif child.vtType == 'annotation':
        return DBAnnotation(id=child.db_id,
                            key=child.db_key,
                            value=child.db_value)
    elif child.vtType == 'port':
        return DBPort(id=child.db_id,
                      type=child.db_type,
                      moduleId=child.db_moduleId,
                      moduleName=child.db_moduleName,
                      name=child.db_name,
                      spec=child.db_spec)
    elif child.vtType == 'group':
        return DBGroup(id=child.db_id,
                       workflow=child.db_workflow,
                       cache=child.db_cache,
                       name=child.db_name,
                       namespace=child.db_namespace,
                       package=child.db_package,
                       version=child.db_version,
                       tag=child.db_tag)
                       
Ejemplo n.º 4
0
def update_modules(old_obj, trans_dict):
    new_modules = []
    for obj in old_obj.db_modules:
        if obj.vtType == "module":
            new_modules.append(DBModule.update_version(obj, trans_dict))
        elif obj.vtType == "abstraction":
            new_modules.append(DBAbstractionRef.update_version(obj, trans_dict))
        elif obj.vtType == "group":
            new_modules.append(DBGroup.update_version(obj, trans_dict))
    return new_modules
Ejemplo n.º 5
0
def update_modules(old_obj, trans_dict):
    new_modules = []
    for obj in old_obj.db_modules:
        if obj.vtType == 'module':
            new_modules.append(DBModule.update_version(obj, trans_dict))
        elif obj.vtType == 'abstraction':
            new_modules.append(DBAbstractionRef.update_version(
                obj, trans_dict))
        elif obj.vtType == 'group':
            new_modules.append(DBGroup.update_version(obj, trans_dict))
    return new_modules