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:
Chris Jones 2010-01-05 12:49:04 +00:00
parent a65fa136e8
commit 58fd86486d
1 changed files with 9 additions and 9 deletions

View File

@ -43,7 +43,7 @@ class Factory(Borg):
err('Factory::isinstance: unknown class type: %s' % classtype)
return(False)
def make(self, product, *args):
def make(self, product, **kwargs):
"""Make the requested product"""
try:
func = getattr(self, 'make_%s' % product.lower())
@ -52,30 +52,30 @@ class Factory(Borg):
return(None)
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"""
import window
return(window.Window())
return(window.Window(**kwargs))
def make_terminal(self, *args):
def make_terminal(self, **kwargs):
"""Make a Terminal"""
import terminal
return(terminal.Terminal())
def make_hpaned(self, *args):
def make_hpaned(self, **kwargs):
"""Make an HPaned"""
import paned
return(paned.HPaned())
def make_vpaned(self, *args):
def make_vpaned(self, **kwargs):
"""Make a VPaned"""
import paned
return(paned.VPaned())
def make_notebook(self, *args):
def make_notebook(self, **kwargs):
"""Make a Notebook"""
import notebook
return(notebook.Notebook(args[0][0]))
return(notebook.Notebook(kwargs['window']))