--- nfo/projects/netfraggle/bin/fraggleEngine.py 2004/08/26 15:25:04 1.3 +++ nfo/projects/netfraggle/bin/fraggleEngine.py 2004/08/27 03:18:30 1.4 @@ -1,18 +1,23 @@ #!/usr/bin/env python -# $Id: fraggleEngine.py,v 1.3 2004/08/26 15:25:04 joko Exp $ +# $Id: fraggleEngine.py,v 1.4 2004/08/27 03:18:30 joko Exp $ # $Log: fraggleEngine.py,v $ +# Revision 1.4 2004/08/27 03:18:30 joko +# new methods: fraggleSync, getTopics +# # Revision 1.3 2004/08/26 15:25:04 joko # added cvs headers # import os from fraggleConstants import * +import FraggleXMLRPC class FraggleEngine: """Back-end doing the work.""" def __init__(self): self.settings = {} + self.topics = {} def getDefaultDir(self): """Gets location of default dir and creates it @@ -50,6 +55,42 @@ else: return None + def fraggleSync(self, config): + + # v1 - demo + self.topics = [ + { + 'name': 'TWiki-NetFraggleTest-ViaTWiki', + 'mode': 'push', + 'target': { + 'url': 'http://netfrag.org/twiki/bin/view/Main/NetFraggleTest', + 'type': 'TWiki', + } + }, + { + 'name': 'TWiki-NetFraggleTest-ViaXMLRPC', + 'mode': 'push', + 'target': { + 'method': 'appendToPage', + 'arguments': ['NetFraggleTest'], + 'type': 'XMLRPC', + } + }, + ] + return + + # v2 - live + + # 1. load payload from remote side + xml_rpc = FraggleXMLRPC.create(self, config) + fragglexml = xml_rpc.FraggleSync() + + # 2. (todo) unmarshal to self.topics (hash) + # self.topics = unmarshal(fragglexml) + + def getTopics(self): + return self.topics + class urlOpener(object): """Opens urls."""