Parse custom file and add params before parsing cmd-line options.
( self, fileName )
| 3222 | globals()[ name ] = value |
| 3223 | |
| 3224 | def parseCustomFile( self, fileName ): |
| 3225 | "Parse custom file and add params before parsing cmd-line options." |
| 3226 | customs = {} |
| 3227 | if os.path.isfile( fileName ): |
| 3228 | with open( fileName, 'r' ) as f: |
| 3229 | exec( f.read() ) # pylint: disable=exec-used |
| 3230 | for name, val in customs.items(): |
| 3231 | self.setCustom( name, val ) |
| 3232 | else: |
| 3233 | raise Exception( 'could not find custom file: %s' % fileName ) |
| 3234 | |
| 3235 | def importTopo( self ): |
| 3236 | info( 'topo='+self.options.topo, '\n' ) |