J
Johannes Bauer
Hello group,
I'm having a seemingly simple problem. I want to generate a hierarchy of
modules, like this one:
GenerationScripts/
GenerationScripts/dhcp
GenerationScripts/bind9
And the files:
GenerationScripts/dhcp/__init__.py
GenerationScripts/bind9/generator.py
GenerationScripts/bind9/__init__.py
GenerationScripts/mastergen.py
GenerationScripts/__init__.py
All packages (bind9, dhcp) should inherit from the master generator
"mastergen".
I'm at the very beginning:
$ cat GenerationScripts/__init__.py
import bind9
#import dhcpd
$ cat GenerationScripts/bind9/__init__.py
import GenerationScripts.bind9.generator
$ cat GenerationScripts/bind9/generator.py
from GenerationScripts import mastergen
class generator(mastergen):
def __init__(self):
print "init bind9 generator"
Now what happens when I import GenerationScripts and try to create a
instance of GenerationScripts.bind9.generator is the following:
Traceback (most recent call last):
File "./Generate.py", line 3, in <module>
import GenerationScripts
File "/home/joe/x/GenerationScripts/__init__.py", line 3, in <module>
import bind9
File "/home/joe/x/GenerationScripts/bind9/__init__.py", line 4, in
<module>
import GenerationScripts.bind9.generator
File "/home/joe/x/GenerationScripts/bind9/generator.py", line 7, in
<module>
class generator(mastergen):
TypeError: Error when calling the metaclass bases
module.__init__() takes at most 2 arguments (3 given)
I really don't get it - and I've searched and found the same problem,
read the descirption - but still don't get it. What's happening here?
Regards,
Johannes
I'm having a seemingly simple problem. I want to generate a hierarchy of
modules, like this one:
GenerationScripts/
GenerationScripts/dhcp
GenerationScripts/bind9
And the files:
GenerationScripts/dhcp/__init__.py
GenerationScripts/bind9/generator.py
GenerationScripts/bind9/__init__.py
GenerationScripts/mastergen.py
GenerationScripts/__init__.py
All packages (bind9, dhcp) should inherit from the master generator
"mastergen".
I'm at the very beginning:
$ cat GenerationScripts/__init__.py
import bind9
#import dhcpd
$ cat GenerationScripts/bind9/__init__.py
import GenerationScripts.bind9.generator
$ cat GenerationScripts/bind9/generator.py
from GenerationScripts import mastergen
class generator(mastergen):
def __init__(self):
print "init bind9 generator"
Now what happens when I import GenerationScripts and try to create a
instance of GenerationScripts.bind9.generator is the following:
Traceback (most recent call last):
File "./Generate.py", line 3, in <module>
import GenerationScripts
File "/home/joe/x/GenerationScripts/__init__.py", line 3, in <module>
import bind9
File "/home/joe/x/GenerationScripts/bind9/__init__.py", line 4, in
<module>
import GenerationScripts.bind9.generator
File "/home/joe/x/GenerationScripts/bind9/generator.py", line 7, in
<module>
class generator(mastergen):
TypeError: Error when calling the metaclass bases
module.__init__() takes at most 2 arguments (3 given)
I really don't get it - and I've searched and found the same problem,
read the descirption - but still don't get it. What's happening here?
Regards,
Johannes