Check-in [a7c3f7336a]
Overview
| Comment: | Fix a few CLI bugs (doesn't work yet with dynamic module list), stub_parent() implementations for non-GUI mode should be merged. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
a7c3f7336a8be0a54d00693002d75ac3 |
| User & Date: | mario on 2015-04-07 05:53:39 |
| Other Links: | manifest | tags |
Context
|
2015-04-07
| ||
| 05:54 | Less indentation, starting to overhaul action.save() at least. (Whole `action` module is overdue.) check-in: 7726e18571 user: mario tags: trunk | |
| 05:53 | Fix a few CLI bugs (doesn't work yet with dynamic module list), stub_parent() implementations for non-GUI mode should be merged. check-in: a7c3f7336a user: mario tags: trunk | |
| 05:51 | Move argv initialization to conf.apply_args(). Document config: format for argparse conversion. Enable file=sys.stderr for __print__/debug messages. check-in: 1eea3140f8 user: mario tags: trunk | |
Changes
Modified channels/__init__.py from [292484f13c] to [11f92592f3].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | # encoding: UTF-8 # api: streamtuner2 # type: base # category: ui # title: Channel plugins # description: Base implementation for channels and feature plugins |
| ︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 128 129 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | + + + |
self.module = self.__class__.__name__
self.meta = plugin_meta(src = inspect.getcomments(inspect.getmodule(self)))
self.config = self.meta.get("config", [])
self.title = self.meta.get("title", self.module)
# add default options values to config.conf.* dict
conf.add_plugin_defaults(self.meta, self.module)
# stub for ST2 main window / dispatcher
self.parent = stub_parent(None)
# only if streamtuner2 is run in graphical mode
if (parent):
self.cache()
self.gui(parent)
pass
|
| ︙ | |||
582 583 584 585 586 587 588 | 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | + + + + + + + + + + + |
# try to initialize superclass now, before adding to channel tabs
GenericChannel.gui(self, parent)
# add notebook tab
tab = parent.notebook_channels.insert_page_menu(vbox, ev_label, plain_label, -1)
parent.notebook_channels.set_tab_reorderable(vbox, True)
# WORKAROUND for direct channel module imports,
# eases instantiations without GUI a little,
# reducing module dependencies (conf. / ahttp. / channels. / parent.) would be better
def stub_parent(object):
def __setattr__(self, name, value):
pass
def __getattr__(self, name):
return lambda *x: None
def status(self, *x):
pass
|
Modified cli.py from [436f001346] to [c8d63f1db6].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | - - - + + - - + + - - - - + - + - + |
|
| ︙ | |||
152 153 154 155 156 157 158 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - + - - + + |
# load all channel modules
def channels(self, channels=None):
if channels:
channels = channels.split(",")
else:
channels = self.channel_modules
|