Check-in [2859a51985]
Overview
| Comment: | Also perform an action.resolve_urn() right when accessing a row. Thus the stremaing lsits get updated on any .row() acccess (= now centrally covered). | 
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive | 
| Timelines: | family | ancestors | descendants | both | trunk | 
| Files: | files | file ages | folders | 
| SHA1: | 2859a51985d4e7f6ffcf9529cde6547d | 
| User & Date: | mario on 2016-11-06 11:40:29 | 
| Other Links: | manifest | tags | 
Context
| 2016-11-06 | ||
| 11:42 | Implement new .resolve_urn() hook (replacing .row() override), which is added automatically now in ChannelPlugin init. check-in: e4fa4859c6 user: mario tags: trunk | |
| 11:40 | Also perform an action.resolve_urn() right when accessing a row. Thus the stremaing lsits get updated on any .row() acccess (= now centrally covered). check-in: 2859a51985 user: mario tags: trunk | |
| 11:39 | Implement resolve_urn() and handlers to look up "urn:xxx:iii" stream urls pripr playback. (Currently just used by reciva and delicast. Now allows to remove channel.row() override.) check-in: 5b63504d79 user: mario tags: trunk | |
Changes
Modified channels/__init__.py from [7b1d9a7374] to [0838ff195b].
| ︙ | ︙ | |||
| 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | 
        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)
        
        # Only if streamtuner2 is run in graphical mode        
        if (parent):
            # Update/display stream processors
            if not self.prepare_filters:
                self.prepare_filters += [
                    self.prepare_filter_icons,
                ]
 | > > > > > > | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | 
        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)
        
        # extra init function
        if hasattr(self, "init2"):
            self.init2(parent)
        if hasattr(self, "resolve_urn"):
            action.handler["urn:%s" % self.module] = self.resolve_urn
        
        # Only if streamtuner2 is run in graphical mode        
        if (parent):
            # Update/display stream processors
            if not self.prepare_filters:
                self.prepare_filters += [
                    self.prepare_filter_icons,
                ]
 | 
| ︙ | ︙ | |||
| 248 249 250 251 252 253 254 | 
    # Return ListStore object and Iterator for currently selected row in gtk.TreeView station list
    def model_iter(self):
        return self.gtk_list.get_selection().get_selected()
    # Currently selected entry in stations list, return complete data dict
    def row(self):
 | > | > > > > > > | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | 
    # Return ListStore object and Iterator for currently selected row in gtk.TreeView station list
    def model_iter(self):
        return self.gtk_list.get_selection().get_selected()
    # Currently selected entry in stations list, return complete data dict
    def row(self):
        no = self.rowno()
        ls = self.stations()
        row = ls[no]
        # resolve stream url for some plugins
        if row["url"].startswith("urn:"):
            row = action.resolve_urn(row)
            ls[no] = row
        return row
        
    # Fetches a single varname from currently selected station entry
    def selected(self, name="url"):
        return self.row().get(name)
    
    # Inject status icon into currently selected row (used by main.bookmark() call)
    def row_icon(self, gtkIcon = gtk.STOCK_ABOUT):
 | 
| ︙ | ︙ |