gui/tools/migrate.py
def migrate_control(comp):
    "Take a pythoncard background resource and convert to a gui2py window"
    ret = {}
    for k, v in comp.items():
        if k == 'type':
            v = CTRL_MAP[v]._meta.name
        elif k == 'menubar':
            pass
        elif k == 'components':
            v = [migrate_control(comp) for comp in v]
        else:
            k = SPEC_MAP['Widget'].get(k, k)
            if comp['type'] in SPEC_MAP:
                k = SPEC_MAP[comp['type']].get(k, k)
            if k == 'font':
                v = migrate_font(v)
        ret[k] = v
    return ret
def migrate_control(comp):
    "Take a pythoncard background resource and convert to a gui2py window"
    ret = {}
    for k, v in comp.items():
        if k == 'type':
            v = CTRL_MAP[v]._meta.name
        elif k == 'menubar':
            pass
        elif k == 'components':
            v = [migrate_control(comp) for comp in v]
        else:
            k = SPEC_MAP['Widget'].get(k, k)
            if comp['type'] in SPEC_MAP:
                k = SPEC_MAP[comp['type']].get(k, k)
            if k == 'font':
                v = migrate_font(v)
        ret[k] = v
    return ret
def migrate_control ( comp ) : ret = { } for k , v in comp . items ( ) : if k == 'type' : v = CTRL_MAP [ v ] . _meta . name elif k == 'menubar' : pass elif k == 'components' : v = [ migrate_control ( comp ) for comp in v ] else : k = SPEC_MAP [ 'Widget' ] . get ( k , k ) if comp [ 'type' ] in SPEC_MAP : k = SPEC_MAP [ comp [ 'type' ] ] . get ( k , k ) if k == 'font' : v = migrate_font ( v ) ret [ k ] = v return ret
Take a pythoncard background resource and convert to a gui2py window
Take a pythoncard background resource and convert to a gui2py window