diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/gras/GRAS_Factory.i | 19 | ||||
-rw-r--r-- | python/gras/__init__.py | 2 |
2 files changed, 9 insertions, 12 deletions
diff --git a/python/gras/GRAS_Factory.i b/python/gras/GRAS_Factory.i index e324d27..b3ba44b 100644 --- a/python/gras/GRAS_Factory.i +++ b/python/gras/GRAS_Factory.i @@ -23,19 +23,16 @@ namespace gras %include <gras/factory.hpp> //////////////////////////////////////////////////////////////////////// -// Create python methods for factories +// Create python make method for the factory //////////////////////////////////////////////////////////////////////// -%pythoncode%{ - -class StaticPyFactory(object): - - def __getattr__(self, name): +%extend gras::Factory +{ + %insert("python") + %{ + @staticmethod def make(name, *args): from PMC import PMC_M pmcargs = PMC_M(list(args)) return Factory._handle_make(name, pmcargs) - return lambda *args: make(name, *args) - -PyFactory = StaticPyFactory() - -%} + %} +} diff --git a/python/gras/__init__.py b/python/gras/__init__.py index 4add913..3c16388 100644 --- a/python/gras/__init__.py +++ b/python/gras/__init__.py @@ -10,7 +10,7 @@ from GRAS_SBuffer import SBufferConfig, SBuffer from GRAS_Tags import Tag, StreamTag, PacketMsg from GRAS_TimeTag import TimeTag from GRAS_Element import Element -from GRAS_Factory import PyFactory as Factory +from GRAS_Factory import Factory import GRAS_Block import GRAS_HierBlock import GRAS_TopBlock |