Skip to content
Snippets Groups Projects
Commit d8c88bed authored by Bob Lantz's avatar Bob Lantz
Browse files

Add custom() function for customizing constructors.

parent 7d557fd7
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
from resource import setrlimit, RLIMIT_NPROC, RLIMIT_NOFILE
from select import poll, POLLIN
from subprocess import call, check_call, Popen, PIPE, STDOUT
from mininet.log import output, error
from mininet.log import output, info, error
import re
# Command execution support
......@@ -282,3 +282,12 @@ def numCores():
except ValueError:
return 0
return numCores.ncores
def custom( cls, **params ):
"Returns customized constructor for class cls."
def customized( *args, **kwargs):
kwargs.update( params )
return cls( *args, **kwargs )
return customized
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment