47 |
self.Destroy() |
self.Destroy() |
48 |
event.Skip() |
event.Skip() |
49 |
|
|
50 |
def load_content(self): |
def load_content(self,contentkey): |
51 |
self.payload = self.engine.listItems('xmlpage') |
self.payload = self.engine.listItems(contentkey) |
52 |
|
self.columns = self.payload['2'] |
53 |
if self.payload: |
if self.payload: |
54 |
print "Done!" |
load3 = self.columns |
55 |
|
colid = 0 |
56 |
|
for i in load3: |
57 |
|
self.listViewMain.InsertColumn( |
58 |
|
col=colid, |
59 |
|
format=wxLIST_FORMAT_LEFT, |
60 |
|
heading=load3[i], |
61 |
|
width=-1 |
62 |
|
) |
63 |
|
colid += 1 |
64 |
|
#print self.payload |
65 |
|
|
66 |
|
entries = self.payload['1'] |
67 |
|
|
68 |
|
itemid = 0 |
69 |
|
|
70 |
|
columnlist = self.columns |
71 |
|
|
72 |
|
for entry in entries: |
73 |
|
colid = 0 |
74 |
|
#print columnlist |
75 |
|
#columnlist.pop() |
76 |
|
for column in columnlist: |
77 |
|
if column == '1' and entries[entry][column] == '1': |
78 |
|
self.listViewMain.InsertStringItem(itemid, 'English') |
79 |
|
elif column == '1' and entries[entry][column] == '2': |
80 |
|
self.listViewMain.InsertStringItem(itemid, 'Deutsch') |
81 |
|
#print entries[entry][column] |
82 |
|
#print "column: "+column |
83 |
|
if column != '1': |
84 |
|
self.listViewMain.SetStringItem(itemid, colid, entries[entry][column]) |
85 |
|
print "colid: "+str(colid) |
86 |
|
colid += 1 |
87 |
|
|
88 |
|
#set custom data |
89 |
|
self.listViewMain.SetItemData(itemid, itemid) |
90 |
|
itemid += 1 |
91 |
|
|
92 |
|
|
93 |
#def load_content(self): |
#def load_content(self): |
94 |
# self.topicid = int(self.GetName()) |
# self.topicid = int(self.GetName()) |
95 |
# self.topicmeta = self.engine.getTopicById(self.topicid) |
# self.topicmeta = self.engine.getTopicById(self.topicid) |