12 |
|
|
13 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
14 |
# $Log$ |
# $Log$ |
15 |
|
# Revision 1.13 2004/09/21 18:07:09 xabbu |
16 |
|
# + added functions listItems and getContent |
17 |
|
# |
18 |
|
# Revision 1.12 2004/09/17 09:42:30 xabbu |
19 |
|
# U function listItems() places a query to the server now and returns its results |
20 |
|
# |
21 |
# Revision 1.11 2004/09/15 22:27:06 xabbu |
# Revision 1.11 2004/09/15 22:27:06 xabbu |
22 |
# +/- function fraggleSync replaced by function syncTopics which places a query |
# +/- function fraggleSync replaced by function syncTopics which places a query |
23 |
# + function query has simple eval of error return code now |
# + function query has simple eval of error return code now |
99 |
def getTopicById(self, id): |
def getTopicById(self, id): |
100 |
return self.topics[id] |
return self.topics[id] |
101 |
|
|
102 |
def listItems(self,topicId): |
def listItems(self,contentkey): |
103 |
result = self.queryCms("GET creator_id, language_id, description FROM contents") |
print contentkey |
104 |
#print result |
result = self.queryCms(str("GET creator_id, language_id, description, id FROM contents WITH type "+contentkey)) |
105 |
|
return result |
106 |
|
|
107 |
|
def getContent(self,contentkey): |
108 |
|
query = str("GET content, creator_id, description, id FROM contents WITH id "+contentkey) |
109 |
|
result = self.queryCms(query) |
110 |
|
print query |
111 |
|
return result |
112 |
|
|
113 |
|
|
114 |
def queryCms(self,nqlquery): |
def queryCms(self,nqlquery): |
115 |
|
|
117 |
rpc = Server('http://netfrag.org/nfo/netfraggle.php') |
rpc = Server('http://netfrag.org/nfo/netfraggle.php') |
118 |
result = rpc.query(nqlquery) |
result = rpc.query(nqlquery) |
119 |
if result['0']['error'] == '0': |
if result['0']['error'] == '0': |
120 |
#print result |
#print result |
121 |
return result |
return result |
122 |
|
|
123 |
#else: |
#else: |
124 |
#print result['0']['error'] |
#print result['0']['error'] |
125 |
#return result |
#return result |