MCPcopy Create free account
hub / github.com/mininet/mininet / parseCustomFile

Method parseCustomFile

examples/miniedit.py:3224–3233  ·  view source on GitHub ↗

Parse custom file and add params before parsing cmd-line options.

( self, fileName )

Source from the content-addressed store, hash-verified

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' )

Callers 1

parseArgsMethod · 0.95

Calls 3

setCustomMethod · 0.95
readMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected