/[cvs]/nfo/projects/netfraggle/bin/fraggleEngine.py
ViewVC logotype

Diff of /nfo/projects/netfraggle/bin/fraggleEngine.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by xabbu, Wed Sep 1 21:43:30 2004 UTC revision 1.10 by xabbu, Mon Sep 13 21:07:38 2004 UTC
# Line 12  Line 12 
12    
13  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
14  # $Log$  # $Log$
15    # Revision 1.10  2004/09/13 21:07:38  xabbu
16    # + function query added for testing of the nql / rpc interface
17    #
18  # Revision 1.9  2004/09/01 21:43:30  xabbu  # Revision 1.9  2004/09/01 21:43:30  xabbu
19  # +Moved funtion getDefaultDir from FraggleCtlPreferences to FraggleEngine for more convenience  # +Moved funtion getDefaultDir from FraggleCtlPreferences to FraggleEngine for more convenience
20  # +FraggleCtlModules class creation for handling content modules  # +FraggleCtlModules class creation for handling content modules
# Line 42  from fraggleConstants import * Line 45  from fraggleConstants import *
45  import FraggleXMLRPC  import FraggleXMLRPC
46  import fraggleCtlPreferences  import fraggleCtlPreferences
47  import FraggleCtlModules  import FraggleCtlModules
48    import fraggleParserXML
49    
50  class FraggleEngine:  class FraggleEngine:
51      """Back-end doing the work."""      """Back-end doing the work."""
# Line 70  class FraggleEngine: Line 74  class FraggleEngine:
74                  return None                  return None
75    
76      def fraggleSync(self):      def fraggleSync(self):
77                    #self.queryCms()
78            fraggleParser = fraggleParserXML.create(self)
79          # v1 - demo          # v1 - demo
80          self.topics = [          self.topics = [
81              {              {
# Line 124  class FraggleEngine: Line 129  class FraggleEngine:
129                  }                  }
130              },              },
131          ]          ]
132            topicfile = os.path.join(self.getDefaultDir(), 'topic.xml')
133            fraggleParser.marshalXML(self.topics,topicfile)
134          return          return
135    
136          # v2 - live          # v2 - live
# Line 139  class FraggleEngine: Line 146  class FraggleEngine:
146            
147      def getTopicById(self, id):      def getTopicById(self, id):
148          return self.topics[id]          return self.topics[id]
149        
150        def listItems(self,topicId):
151            result = self.queryCms("GET creator_id, language_id, description FROM contents")
152            print result
153            
154        def queryCms(self,nqlquery):
155            
156            from xmlrpclib import Server,Error
157            rpc = Server('http://netfrag.org/nfo/netfraggle.php')
158            topicdata = rpc.query(nqlquery)
159            print topicdata
160            return topicdata
161        
162      def query_remote(self, topicmeta):      def query_remote(self, topicmeta):
163    
164          if topicmeta['target']['type'] == 'XMLRPC':          if topicmeta['target']['type'] == 'XMLRPC':

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed