Protocols such as SpellClient have access to their factory as self.factory.
... so there would be several ways to do this, but one way would be to create another SpellFactory method like setQuery and then access it from the client ...
#...in SpellFactory: def setQuery(self, query): self.query = query
... therefore basically:
f = SpellFactory() f.setQuery('some query') ...
... or you can just create the _init_ method for SpellFactory and pass it there.
source share