34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 | # collections. Commercial and sign-up services are not an objective.
#
# standard modules
import sys
import os, os.path
import re
from collections import namedtuple
from copy import copy
import traceback
from threading import Thread
# add library path
sys.path.insert(0, "/usr/share/streamtuner2") # pre-defined directory for modules
sys.path.insert(0, ".") # development module path
|
|
<
>
| 34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 | # collections. Commercial and sign-up services are not an objective.
#
# standard modules
import sys
import os
import re
from copy import copy
import inspect
import traceback
from threading import Thread
# add library path
sys.path.insert(0, "/usr/share/streamtuner2") # pre-defined directory for modules
sys.path.insert(0, ".") # development module path
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101 | add_signals = {} # channel gtk-handler signals
hooks = {
"play": [favicon.download_playing], # observers queue here
"init": [],
"config_load": [],
"config_save": [],
}
__version__ = "2.1.5"
# status variables
channel_names = ["bookmarks"] # order of channel notebook tabs
current_channel = "bookmarks" # currently selected channel name (as index in self.channels{})
# constructor
def __init__(self):
# gtkrc stylesheet
self.load_theme(), gui_startup(1/20.0)
# instantiate gtk/glade widgets in current object
gtk.Builder.__init__(self)
gtk.Builder.add_from_file(self, conf.find_in_dirs([".", conf.share], ui_file)), gui_startup(2/20.0)
# manual gtk operations |
|
|
| 78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101 | add_signals = {} # channel gtk-handler signals
hooks = {
"play": [favicon.download_playing], # observers queue here
"init": [],
"config_load": [],
"config_save": [],
}
meta = plugin_meta()
# status variables
channel_names = ["bookmarks"] # order of channel notebook tabs
current_channel = "bookmarks" # currently selected channel name (as index in self.channels{})
# constructor
def __init__(self):
# gtkrc stylesheet
self.load_theme(), gui_startup(1/20.0)
# instantiate gtk/glade widgets in current object
gtk.Builder.__init__(self)
gtk.Builder.add_from_file(self, conf.find_in_dirs([".", conf.share], ui_file)), gui_startup(2/20.0)
# manual gtk operations |
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428 | continue
# or if it's a built-in (already imported)
elif module in self.features or module in self.channels:
continue
# load plugin
try:
plugin = __import__("channels."+module, None, None, [""])
plugin_class = plugin.__dict__[module]
plugin_obj = plugin_class(parent=self)
# load .config settings from plugin
conf.add_plugin_defaults(plugin_obj.meta["config"], module)
# add and initialize channel |
|
>
| 414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429 | continue
# or if it's a built-in (already imported)
elif module in self.features or module in self.channels:
continue
# load plugin
try:
plugin = __import__("channels."+module, globals(), None, [""])
#print [name for name,c in inspect.getmembers(plugin) if inspect.isclass(c)]
plugin_class = plugin.__dict__[module]
plugin_obj = plugin_class(parent=self)
# load .config settings from plugin
conf.add_plugin_defaults(plugin_obj.meta["config"], module)
# add and initialize channel |