#☺tempo[key] = ', '.join(brev[key]) elif isinstance(brev[key], list) and len(brev[key]) == 1: if brev[key][0] is not None: tempo[key] = brev[key][0] else: tempo[key] = '' elif brev[key] is None: tempo[key] = '' else: tempo[key] = brev[key] except: tempo[key] = "0" #hum this is fully arbttrary... # tempo[url] tempo['inventor-url'] = UrlInventorBuild(brev['inventor']) tempo['applicant-url'] = UrlApplicantBuild(brev['applicant']) for nb in [1, 3, 4, 7, 11]: tempo['IPCR' + str(nb) + '-url'] = UrlIPCRBuild(brev['IPCR' + str(nb)]) tempo['equivalents-url'] = [ UrlPatent(lab) for lab in brev['equivalents'] ] tempo['label-url'] = UrlPatent(brev['label']) LstExp.append(tempo) # filtering against keys in clesRefs2 for pivottable # tempo2=dict() # clesRef2 = ['label', 'year', 'priority-active-indicator', 'kind', 'applicant', 'country', 'inventor', 'IPCR4', 'IPCR7', "Inventor-Country", "Applicant-Country", 'Citations', u'references', 'CitedBy', ] #'citations','representative', # for ket in clesRef2: # tempo2[ket] = brev[ket] #filtering against clesRef2
elif G1.node[k]['category'] == 'IPCR1' or G1.node[k][ 'category'] == 'IPCR3' or G1.node[k][ 'category'] == 'IPCR4' or G1.node[k][ 'category'] == 'IPCR7' or G1.node[k][ 'category'] == 'IPCR7' or G1.node[k][ 'category'] == 'CPC': G1.node[k]['url'] = UrlIPCRBuild(G1.node[k]['label'])[0] Visu['color']['a'] = 1 Visu['color']['r'] = int(127) Visu['color']['g'] = int(254) Visu['color']['b'] = int(127) Visu['shape'] = "database" elif G1.node[k]['category'] == 'inventor-nice': G1.node[k][ 'category'] = 'inventor' # for readable facility G1.node[k]['url'] = UrlInventorBuild( G1.node[k]['label'])[0] Visu['color']['a'] = 1 Visu['color']['r'] = int(127) Visu['color']['g'] = int(127) Visu['color']['b'] = int(254) Visu['shape'] = "triangleDown" else: Visu['color']['a'] = 1 Visu['color']['r'] = int(254) Visu['color']['g'] = int(254) Visu['color']['b'] = int(254) Visu['shape'] = "box" if "label" not in mixNet: mixNet.append('label') #factx, facty = 500, 400 Visu['size'] = G1.node[k]["degree"] * 10.0 / Maxdegs