--- nfo/projects/netfraggle/bin/fraggleEngine.py 2004/09/01 21:43:30 1.9 +++ nfo/projects/netfraggle/bin/fraggleEngine.py 2004/09/13 21:07:38 1.10 @@ -5,13 +5,16 @@ # Author: joko # # Created: 2004/30/08 -# RCS-ID: $Id: fraggleEngine.py,v 1.9 2004/09/01 21:43:30 xabbu Exp $ +# RCS-ID: $Id: fraggleEngine.py,v 1.10 2004/09/13 21:07:38 xabbu Exp $ # Copyright: (c) 2004 netfrag.org # Licence: GPL #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # $Log: fraggleEngine.py,v $ +# Revision 1.10 2004/09/13 21:07:38 xabbu +# + function query added for testing of the nql / rpc interface +# # Revision 1.9 2004/09/01 21:43:30 xabbu # +Moved funtion getDefaultDir from FraggleCtlPreferences to FraggleEngine for more convenience # +FraggleCtlModules class creation for handling content modules @@ -42,6 +45,7 @@ import FraggleXMLRPC import fraggleCtlPreferences import FraggleCtlModules +import fraggleParserXML class FraggleEngine: """Back-end doing the work.""" @@ -70,7 +74,8 @@ return None def fraggleSync(self): - + #self.queryCms() + fraggleParser = fraggleParserXML.create(self) # v1 - demo self.topics = [ { @@ -124,6 +129,8 @@ } }, ] + topicfile = os.path.join(self.getDefaultDir(), 'topic.xml') + fraggleParser.marshalXML(self.topics,topicfile) return # v2 - live @@ -139,7 +146,19 @@ def getTopicById(self, id): return self.topics[id] - + + def listItems(self,topicId): + result = self.queryCms("GET creator_id, language_id, description FROM contents") + print result + + def queryCms(self,nqlquery): + + from xmlrpclib import Server,Error + rpc = Server('http://netfrag.org/nfo/netfraggle.php') + topicdata = rpc.query(nqlquery) + print topicdata + return topicdata + def query_remote(self, topicmeta): if topicmeta['target']['type'] == 'XMLRPC':