2 |
|
|
3 |
# $Id$ |
# $Id$ |
4 |
# $Log$ |
# $Log$ |
5 |
|
# Revision 1.4 2004/08/27 03:18:30 joko |
6 |
|
# new methods: fraggleSync, getTopics |
7 |
|
# |
8 |
# Revision 1.3 2004/08/26 15:25:04 joko |
# Revision 1.3 2004/08/26 15:25:04 joko |
9 |
# added cvs headers |
# added cvs headers |
10 |
# |
# |
11 |
|
|
12 |
import os |
import os |
13 |
from fraggleConstants import * |
from fraggleConstants import * |
14 |
|
import FraggleXMLRPC |
15 |
|
|
16 |
class FraggleEngine: |
class FraggleEngine: |
17 |
"""Back-end doing the work.""" |
"""Back-end doing the work.""" |
18 |
def __init__(self): |
def __init__(self): |
19 |
self.settings = {} |
self.settings = {} |
20 |
|
self.topics = {} |
21 |
|
|
22 |
def getDefaultDir(self): |
def getDefaultDir(self): |
23 |
"""Gets location of default dir and creates it |
"""Gets location of default dir and creates it |
55 |
else: |
else: |
56 |
return None |
return None |
57 |
|
|
58 |
|
def fraggleSync(self, config): |
59 |
|
|
60 |
|
# v1 - demo |
61 |
|
self.topics = [ |
62 |
|
{ |
63 |
|
'name': 'TWiki-NetFraggleTest-ViaTWiki', |
64 |
|
'mode': 'push', |
65 |
|
'target': { |
66 |
|
'url': 'http://netfrag.org/twiki/bin/view/Main/NetFraggleTest', |
67 |
|
'type': 'TWiki', |
68 |
|
} |
69 |
|
}, |
70 |
|
{ |
71 |
|
'name': 'TWiki-NetFraggleTest-ViaXMLRPC', |
72 |
|
'mode': 'push', |
73 |
|
'target': { |
74 |
|
'method': 'appendToPage', |
75 |
|
'arguments': ['NetFraggleTest'], |
76 |
|
'type': 'XMLRPC', |
77 |
|
} |
78 |
|
}, |
79 |
|
] |
80 |
|
return |
81 |
|
|
82 |
|
# v2 - live |
83 |
|
|
84 |
|
# 1. load payload from remote side |
85 |
|
xml_rpc = FraggleXMLRPC.create(self, config) |
86 |
|
fragglexml = xml_rpc.FraggleSync() |
87 |
|
|
88 |
|
# 2. (todo) unmarshal to self.topics (hash) |
89 |
|
# self.topics = unmarshal(fragglexml) |
90 |
|
|
91 |
|
def getTopics(self): |
92 |
|
return self.topics |
93 |
|
|
94 |
|
|
95 |
class urlOpener(object): |
class urlOpener(object): |
96 |
"""Opens urls.""" |
"""Opens urls.""" |