~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to madgraph/iolibs/gen_infohtml.py

  • Committer: olivier Mattelaer
  • Date: 2015-03-05 00:14:16 UTC
  • mfrom: (258.1.9 2.3)
  • mto: (258.8.1 2.3)
  • mto: This revision was merged to the branch mainline in revision 259.
  • Revision ID: olivier.mattelaer@uclouvain.be-20150305001416-y9mzeykfzwnl9t0j
partial merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import re
20
20
import sys
21
21
 
 
22
import madgraph.various.misc as misc
 
23
 
22
24
template_text= string.Template("""
23
25
<HTML> 
24
26
<HEAD> 
143
145
class make_info_html:
144
146
 
145
147
    def __init__(self, cur_dir='./'):
 
148
 
146
149
        self.dir = cur_dir
147
150
        
 
151
        
148
152
        self.rep_rule = {'nb_diag': 0, 'nb_gen_diag': 0}
149
153
        
150
154
        self.define_meta()
228
232
                line_dict['subprocesslist'] = ', <br>'.join([' </SPAN> , <SPAN style="white-space: nowrap;"> '.join(info) for info in names])
229
233
                line_dict['postscript'] = self.check_postcript(proc, id)
230
234
                
231
 
                
232
 
            
233
235
                text += line_template.substitute(line_dict)
234
236
        return text
235
237
    
251
253
    def get_subprocesses_info(self, proc):
252
254
        """ return the list of processes with their name"""    
253
255
        
 
256
        #no python information available (should not happen anymore)
254
257
        path = os.path.join(self.dir, 'SubProcesses', proc)        
255
258
        nb_sub = 0
256
259
        names = {}
275
278
                names[main] += [sub_proccess.split(',')]
276
279
            else: 
277
280
                names[main]= [sub_proccess.split(',')]
278
 
                
 
281
    
 
282
 
279
283
        return names
280
284
 
281
285
    def get_subprocess_info_v4(self, proc):
311
315
        </TR>"""
312
316
        else:
313
317
            return ''
 
318
        
314
319
    def write(self):
315
320
        """write the info.html file"""
316
321
        
394
399
        if not os.path.exists(path):
395
400
            return []
396
401
        found = 0
 
402
        start= 0
397
403
        for line in open(path):
398
404
            if line.startswith('C     Process:'):
399
405
                found += 1
400
 
                names[''][0].append(line[15:])
 
406
                names[''][0].append(line[15:-1])
 
407
                start =1
401
408
            elif found >0 and 'IMPLICIT NONE' in line:
402
409
                break    
 
410
            elif start:
 
411
                names[''][0][-1] += line[2:-1].strip()
403
412
        return names    
404
413
 
405
414