def ecosystem(pdf,fac,p,g): if g == 0: filename = p+'BULLETS.FAC-'+fac tempString="FAC-" else: filename = p+'BULLETS.GANG'+fac tempString="GANG" f = p+'SUBGROUP-RELATIONS' vna2mpb3.subgrouprelations(p,tempString+fac,1) reader = csv.reader(open(filename+'.csv', 'rb'),delimiter=',') pdf.set_font('Helvetica','BU',8) pdf.cell(0,3,''+fac+' ECOSYSTEM',0,1,'C') image1 = p+tempString+fac+'-subgrouprelations.png' pdf.image(image1,30,30,150,100,type='') pdf.set_font('Helvetica','',8) pdf.ln(115) for row in reader: #new row if row: if row[0] != '': #if the row isn't null, it has a name pdf.cell(0,3,''+row[0],0,0) pdf.ln() else: #the row is null, it is a listing maxlen = len(row) i = 2 str1='' while (i<maxlen): if pdf.get_string_width(str1) > 150: pdf.cell(150,3,' '+str1,0,0) pdf.ln() str1 = '' else: str1 = str1 +str(row[i]).rstrip()+', ' i=i+1 str2 = ' '+str1 str3 = str2[:len(str2)-4] pdf.cell(150,3,str3,0,0) pdf.ln() pdf.ln()
def Show_Sub_Group_Relations(analyzeThis): vna2mpb3.subgrouprelations(analyzeThis[1]+"\\",analyzeThis[0],0)