chromecow
Visitor
|
Problem Registering New Module - 2008/03/14 21:37
Just getting my feet wet with modules. I've built a very simple module called:
existsQueries.py
Which (theoretically) receives the node <exists> and returns "I Exist!"
Here is the code (minus the GNU comment block):
| Code: | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Palabre - existsQueries.py
class existsQueries:
def __init__(self,server):
self.server = server
self.name = "existsQueries"
self.server.registerAction(’onStartup’,self.name)
# Registering the EXISTS node
self.server.registerNode('exists',self.name)
return
def doNode(self,nodeName,node,client):
if nodeName == 'exists':
client.clientSendMessage(self.server.formatMessage('exists',[],'I Exist!'))
return
|
I saved the module to /usr/local/lib/python2.4/site-packages/modules/
I stopped palabre, edited the /etc/palabre.conf to read:
[modules]
list = dbQueries,helloworld,simpleLogin,existsQueries
I restarted palabre, and got this:
| Code: | [root@someserver palabre-src-0.6b]# python Palabre.py
INFO No log file has been specified
INFO Palabre will only print log to console
INFO Running on: xx.xxx.xx.xxx
INFO Port: 2468
INFO Palabre is running on a public interface
INFO Other computers will be able to access it
INFO 4 Module(s) to load
INFO Module : dbQueries Loaded
INFO Module : helloworld Loaded
INFO Module : simpleLogin Loaded
ERROR ERROR : No module named existsQueries
ERROR Module : existsQueries Failed to load
INFO 3 Module(s) loaded
INFO Connection to BDD SKIPPED
ERROR dbQueries:DATABASE ACCESS IS NOT CONFIGURED
ERROR dbQueries:I wont accept any request
|
What am I missing?
Help me, Obi Wan!
|