︙ | | | ︙ | |
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# file. They derive from the ChannelPlugins class instead, which
# adds the required gtk Widgets manually.
#
import gtk
from mygtk import mygtk
from config import conf
import http
import action
import favicon
import os.path
import xml.sax.saxutils
import re
import copy
# dict==object
class struct(dict):
def __init__(self, *xargs, **kwargs):
self.__dict__ = self
self.update(kwargs)
|
|
<
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# file. They derive from the ChannelPlugins class instead, which
# adds the required gtk Widgets manually.
#
import gtk
from mygtk import mygtk
from config import conf, __print__, dbg
import http
import action
import favicon
import os.path
import xml.sax.saxutils
import re
import copy
# dict==object
class struct(dict):
def __init__(self, *xargs, **kwargs):
self.__dict__ = self
self.update(kwargs)
|
︙ | | | ︙ | |
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
#if (self.liststore.has_key(category)):
# del self.liststore[category]
else:
# parse error
self.parent.status("category parsed empty.")
self.streams[category] = [{"title":"no contents found on directory server","bitrate":0,"max":0,"listeners":0,"playing":"error","favourite":0,"deleted":0}]
print("oooops, parser returned nothing for category " + category)
# assign to treeview model
#self.streams[self.default] = []
#if (self.liststore.has_key(category)): # was already loded before
# self.gtk_list.set_model(self.liststore[category])
#else: # currently list is new, had not been converted to gtk array before
# self.liststore[category] = \
|
|
|
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
#if (self.liststore.has_key(category)):
# del self.liststore[category]
else:
# parse error
self.parent.status("category parsed empty.")
self.streams[category] = [{"title":"no contents found on directory server","bitrate":0,"max":0,"listeners":0,"playing":"error","favourite":0,"deleted":0}]
__print__(dbg.ERR, "Oooops, parser returned nothing for category " + category)
# assign to treeview model
#self.streams[self.default] = []
#if (self.liststore.has_key(category)): # was already loded before
# self.gtk_list.set_model(self.liststore[category])
#else: # currently list is new, had not been converted to gtk array before
# self.liststore[category] = \
|
︙ | | | ︙ | |
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
self.load(self.current, force=1)
def switch(self):
self.load(self.current, force=0)
# display .current category, once notebook/channel tab is first opened
def first_show(self):
print("first_show ", self.module)
print 1
print self.shown
if (self.shown != 55555):
print 2
# if category tree is empty, initialize it
if not self.categories:
print 3
#self.parent.thread(self.reload_categories)
print("reload categories");
self.reload_categories()
self.display_categories()
self.current = self.categories.keys()[0]
print self.current
self.load(self.current)
# load current category
else:
print 4
self.load(self.current)
# put selection/cursor on last position
try:
print 5
self.gtk_list.get_selection().select_path(self.shown)
except:
pass
# this method will only be invoked once
self.shown = 55555
|
|
|
<
<
|
|
|
|
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
self.load(self.current, force=1)
def switch(self):
self.load(self.current, force=0)
# display .current category, once notebook/channel tab is first opened
def first_show(self):
__print__(dbg.PROC, "first_show ", self.module, self.shown)
if (self.shown != 55555):
# if category tree is empty, initialize it
if not self.categories:
__print__(dbg.PROC, "first_show: reload_categories");
#self.parent.thread(self.reload_categories)
print("reload categories");
self.reload_categories()
self.display_categories()
self.current = self.categories.keys()[0]
print self.current
self.load(self.current)
# load current category
else:
__print__(dbg.STAT, "first_show: load current category");
self.load(self.current)
# put selection/cursor on last position
try:
__print__(dbg.STAT, "first_show: select last known category treelist position")
self.gtk_list.get_selection().select_path(self.shown)
except:
pass
# this method will only be invoked once
self.shown = 55555
|
︙ | | | ︙ | |
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
|
# add module to list
#parent.channels[module] = None
#parent.channel_names.append(module)
""" -> already taken care of in main.load_plugins() """
# wrapper for all print statements
def __print__(*args):
if conf.debug:
print(" ".join([str(a) for a in args]))
__debug_print__ = __print__
|
<
<
<
<
<
<
<
<
<
<
<
|
524
525
526
527
528
529
530
531
532
533
|
# add module to list
#parent.channels[module] = None
#parent.channel_names.append(module)
""" -> already taken care of in main.load_plugins() """
|