~maddevelopers/mg5amcnlo/aMCatNLO

« back to all changes in this revision

Viewing changes to madgraph/iolibs/export_fks.py

  • Committer: Valentin Hirschi
  • Date: 2012-12-18 09:10:58 UTC
  • mfrom: (550.1.11 aMCatNLO)
  • Revision ID: spooner@pb-d-128-141-163-97.cern.ch-20121218091058-x950ogffu0odfard
1. Merged with latest revision of launchpad and made the MadLoop command 
   test safer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
    def convert_model_to_mg4(self, model, wanted_lorentz = [], 
194
194
                                                         wanted_couplings = []):
195
195
         
196
 
         super(ProcessExporterFortranFKS,self).convert_model_to_mg4(model, 
 
196
        super(ProcessExporterFortranFKS,self).convert_model_to_mg4(model, 
197
197
                                               wanted_lorentz, wanted_couplings)
198
198
         
199
 
         IGNORE_PATTERNS = ('*.pyc','*.dat','*.py~')
200
 
         try:
201
 
             shutil.rmtree(pjoin(self.dir_path,'bin','internal','ufomodel'))
202
 
         except OSError as error:
203
 
             pass
204
 
         # Notice that what is below is not safe for path including '-'.
205
 
         shutil.copytree(model.get('version_tag').split('##')[0].split('-')[0], 
 
199
        IGNORE_PATTERNS = ('*.pyc','*.dat','*.py~')
 
200
        try:
 
201
            shutil.rmtree(pjoin(self.dir_path,'bin','internal','ufomodel'))
 
202
        except OSError as error:
 
203
            pass
 
204
        model_path = model.get('modelpath')
 
205
        shutil.copytree(model_path, 
206
206
                               pjoin(self.dir_path,'bin','internal','ufomodel'),
207
207
                               ignore=shutil.ignore_patterns(*IGNORE_PATTERNS))
208
 
         if hasattr(model, 'restrict_card'):
209
 
             out_path = pjoin(self.dir_path, 'bin', 'internal','ufomodel',
 
208
        if hasattr(model, 'restrict_card'):
 
209
            out_path = pjoin(self.dir_path, 'bin', 'internal','ufomodel',
210
210
                                                         'restrict_default.dat')
211
 
             if isinstance(model.restrict_card, check_param_card.ParamCard):
212
 
                 model.restrict_card.write(out_path)
213
 
             else:
214
 
                 files.cp(model.restrict_card, out_path)
 
211
            if isinstance(model.restrict_card, check_param_card.ParamCard):
 
212
                model.restrict_card.write(out_path)
 
213
            else:
 
214
                files.cp(model.restrict_card, out_path)
215
215
 
216
216
 
217
217