Interpreters and instances

Posted by Poromenos on Wed 04 Mar 2009 01:13 AM — 4 posts, 18,542 views.

Greece #0
Is there a way for me to start a new interpreter per character/plugin/something? I currently have two plugins that utilize an ORM and I can't have them both loaded in the same MC instance or it chokes. How could this problem be solved?
Australia Forum Administrator #1
What do you mean a new interpreter? MUSHclient creates a new script engine instance for each world, and each plugin within a world.
Greece #2
It does? Why do my plugins conflict then? This is odd, I'll have to test a bit more.
Greece #3
This is the error it presents when I load two plugins that use SQLobject (each plugin works fine by itself):


Script error
Plugin: Donation (called from world: Poromenos)
Execution of line 5 column 0
Immediate execution
Traceback (most recent call last):
  File "<Script Block >", line 5, in <module>
    class Character(SQLObject):
  File "i:\libs\python25\lib\site-packages\SQLObject-0.10.4-py2.5.egg\sqlobject\declarative.py", line 92, in __new__
    cls.__classinit__(cls, new_attrs)
  File "i:\libs\python25\lib\site-packages\SQLObject-0.10.4-py2.5.egg\sqlobject\main.py", line 810, in __classinit__
    classregistry.registry(cls.sqlmeta.registry).addClass(cls)
  File "i:\libs\python25\lib\site-packages\SQLObject-0.10.4-py2.5.egg\sqlobject\classregistry.py", line 91, in addClass
    '__file__', '(unknown)')))
ValueError: class Character is already in the registry (other class is <class '__ax_main__.Character'>, from the module __ax_main__ in (unknown); attempted new class is <class '__ax_main__.Character'>, from the module __ax_main__ in (unknown))