Switch to using **kwargs instead of *args for the added flexibility it brings. We need to support keyword arguments for Window.__init__()
This commit is contained in:
parent
a65fa136e8
commit
58fd86486d
|
@ -43,7 +43,7 @@ class Factory(Borg):
|
||||||
err('Factory::isinstance: unknown class type: %s' % classtype)
|
err('Factory::isinstance: unknown class type: %s' % classtype)
|
||||||
return(False)
|
return(False)
|
||||||
|
|
||||||
def make(self, product, *args):
|
def make(self, product, **kwargs):
|
||||||
"""Make the requested product"""
|
"""Make the requested product"""
|
||||||
try:
|
try:
|
||||||
func = getattr(self, 'make_%s' % product.lower())
|
func = getattr(self, 'make_%s' % product.lower())
|
||||||
|
@ -52,30 +52,30 @@ class Factory(Borg):
|
||||||
return(None)
|
return(None)
|
||||||
|
|
||||||
dbg('Factory::make: created a %s' % product)
|
dbg('Factory::make: created a %s' % product)
|
||||||
return(func(args))
|
return(func(**kwargs))
|
||||||
|
|
||||||
def make_window(self, *args):
|
def make_window(self, **kwargs):
|
||||||
"""Make a Window"""
|
"""Make a Window"""
|
||||||
import window
|
import window
|
||||||
return(window.Window())
|
return(window.Window(**kwargs))
|
||||||
|
|
||||||
def make_terminal(self, *args):
|
def make_terminal(self, **kwargs):
|
||||||
"""Make a Terminal"""
|
"""Make a Terminal"""
|
||||||
import terminal
|
import terminal
|
||||||
return(terminal.Terminal())
|
return(terminal.Terminal())
|
||||||
|
|
||||||
def make_hpaned(self, *args):
|
def make_hpaned(self, **kwargs):
|
||||||
"""Make an HPaned"""
|
"""Make an HPaned"""
|
||||||
import paned
|
import paned
|
||||||
return(paned.HPaned())
|
return(paned.HPaned())
|
||||||
|
|
||||||
def make_vpaned(self, *args):
|
def make_vpaned(self, **kwargs):
|
||||||
"""Make a VPaned"""
|
"""Make a VPaned"""
|
||||||
import paned
|
import paned
|
||||||
return(paned.VPaned())
|
return(paned.VPaned())
|
||||||
|
|
||||||
def make_notebook(self, *args):
|
def make_notebook(self, **kwargs):
|
||||||
"""Make a Notebook"""
|
"""Make a Notebook"""
|
||||||
import notebook
|
import notebook
|
||||||
return(notebook.Notebook(args[0][0]))
|
return(notebook.Notebook(kwargs['window']))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue