def mount_node(term,id,purpose): conn= MySQLdb.connect(host='dbmy0023.whservidor.com', user='******' , passwd='acc159753', db='mindnet') l=Identify.prepare_layout(conn,id,purpose) allp=[] onto=Identify.prepare_data_by_ask(l, term,id,purpose,allp ) conn.close() return [onto,allp]
def entry(param, data_parse): l = Identify.prepare_layout('igor.moraes', 'common-indentify') l2 = Identify.prepare_layout('igor.moraes', 'common-indentify') onto = Identify.prepare_data_by_ask(l, param, 'igor.moraes', 'common-indentify', []) for dta in data_parse: #print 'process data:',dta ir = Identify.process_data(l2, dta, onto, 'common-indentify', 'igor.moraes') for topico in ir[0].topicos: if len(topico.dt) > 0: print '===========================================' print topico.dt print 'sins:--' def pr(topico): for p in topico.sinapses: print p.nr.dt if p.opcode == 'Relaction': print '?????????????????????????????????' pr(p.nr) print '?????????????????????????????????' elif p.opcode == "cmpp": print ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;' pr(topico) print '-------' print '==========================================='
def mount_node(term, id, purposes): rets = [] for purpose in purposes: l = Identify.prepare_layout(id, purpose) allp = [] onto = Identify.prepare_data_by_ask(l, term, id, purpose, allp) rets.append([onto, allp]) return rets
def entry_process(param, data_parse, usr): layouts_f = get_layouts(usr, 'simple-search') layouts_f2 = get_layouts2(usr, 'simple-search') rets = [] str_ret = [] l = Identify.prepare_layout(usr, 'simple-search') l2 = Identify.prepare_layout(usr, 'simple-search') onto = Identify.prepare_data_by_ask(l, param, usr, 'simple-search', []) for dta in data_parse: ir = Identify.process_data(l2, dta, onto, 'simple-search', usr) if ir[0] == None: continue for topico in ir[0].topicos: if len(topico.dt) > 0: it = topico.dt its = [] for p in topico.sinapses: its.append([p.opcode, p.nr.dt]) rets.append([it, its]) for tp in rets: if 'identificador' in tp[0]: c2 = tp[1] for tp2 in c2: for dt in tp2[1]: str_ret.append(dt) #======================================== sret = '%' for s in str_ret: sret += (s + '%') #================== if sret == '%': sret += (param + '%') return sret
def mount_node(term,id,purpose): l=Identify.prepare_layout(id,purpose) allp=[] onto=Identify.prepare_data_by_ask(l, term,id,purpose,allp ) return [onto,allp]