def edit_local_composition(): g = DfGlobal() try: domain = eval(g["utils.lc.domain"].get()) except: domain = MkGraph(1,"@red 00") try: codomains = eval(g["utils.lc.codomains"].get()) except: codomains = None try: cmap = eval(g["utils.lc.colmaps"].get()) except: cmap = None try: vpos = eval(g["utils.lc.vtxpos"].get()) except: vpos = None try: vmap = eval(g["utils.lc.vtxmaps"].get()) except: vmap = None try: beh = eval(g["utils.lc.behaviours"].get()) except: beh = None try: tags = eval(g["utils.lc.tags"].get()) except: tags = None lceditor = LocalCompositionEditor(domain,vpos,codomains,vmap,cmap,beh,tags) lceditor.edit(g["root.window"]) lst = ["utils.lc.domain","utils.lc.codomains","utils.lc.colmaps",\ "utils.lc.vtxmaps","utils.lc.behaviours","utils.lc.tags",\ "utils.lc.vtxpos"] for k in lst: g[k].delete(0,END) g["utils.lc.domain"].insert(0, repr(lceditor.domain)) g["utils.lc.codomains"].insert(0, repr(lceditor.codomains)), g["utils.lc.colmaps"].insert(0,repr(lceditor.colorMaps)) g["utils.lc.vtxmaps"].insert(0,repr(lceditor.vertexMaps)) g["utils.lc.vtxpos"].insert(0,repr(lceditor.vertexPos)) g["utils.lc.behaviours"].insert(0,str(lceditor.behaviours)) g["utils.lc.tags"].insert(0, repr(lceditor.tags)) for k in lst: frontend_command("DfGlobal()["+repr(k)+"] = "+repr(g[k].get()))
def save_state2(): path = tkFileDialog.asksaveasfilename(\ title="Save restore script to file...") if path: frontend_command("save_state("+repr(path)+")")
def stop_command(): frontend_command("DfGlobal()['concept.list'] = []\n"+\ "DfGlobal()['mind'].switchJamMode(False)\n"+\ "DfGlobal()['mind'].quick_change()")
def edit_graph_hom(): g = DfGlobal() try: domain = eval(g["utils.g.domain"].get()) except: domain = MkGraph(1,"@red 00") try: codomain = eval(g["utils.g.codomain"].get()) except: codomain = PotentialGraph() try: colormap = eval(g["utils.g.colormap"].get()) except: colormap = {} try: vertexmap = eval(g["utils.g.vertexmap"].get()) except: vertexmap = {} try: vertexpos = eval(g["utils.g.vertexpos"].get()) except: vertexpos = {} ghom = CoDiMuGraphHomEditor(domain, codomain, colormap, vertexmap, vertexpos) ghom.edit(g["root.window"]) g["utils.g.vertexmap"].delete(0,END) g["utils.g.vertexmap"].insert(0, repr(ghom.vertexMap)) g["utils.g.colormap"].delete(0,END) g["utils.g.colormap"].insert(0, repr(ghom.colorMap)) g["utils.g.behaviour"].delete(0,END) g["utils.g.behaviour"].insert(0, str(ghom.behaviour)) g["utils.g.vertexpos"].delete(0,END) g["utils.g.vertexpos"].insert(0, str(ghom.vertexPos)) frontend_command("DfGlobal()['utils.g.vertexmap'] = "+repr(repr(ghom.vertexMap))) frontend_command("DfGlobal()['utils.g.colormap'] = "+repr(str(ghom.colorMap))) frontend_command("DfGlobal()['utils.g.behaviour'] = "+repr(repr(ghom.behaviour))) frontend_command("DfGlobal()['utils.g.vertexpos'] = "+repr(repr(ghom.vertexPos))) frontend_command("DfGlobal()['utils.g.domain'] = "+repr(repr(domain))) frontend_command("DfGlobal()['utils.g.codomain'] = "+repr(repr(codomain)))