100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
conf.save(self.module, self.streams, nice=1)
# checks for existence of an URL in bookmarks store,
# this method is called by other channel modules' display() method
def is_in(self, url, once=1):
if (not self.urls):
self.urls = [str(row.get("url","urn:x-streamtuner2:no")) for row in self.streams["favourite"]]
return str(url) in self.urls
# called from main window / menu / context menu,
# when bookmark is to be added for a selected stream entry
def add(self, row, target="favourite"):
# Add / copy some row attributes
row["favourite"] = 1
if not row.get("favicon"):
pass# row["favicon"] = favicon.file(row.get("homepage"))
if not row.get("listformat"):
row["listformat"] = self.parent.channel().listformat
if not len(row.get("extra", "")):
row["extra"] = self.parent.channel().module
# append to storage
self.streams[target].append(row)
self.save()
self.load(self.default)
self.urls.append(row["url"])
# simplified gtk TreeStore display logic (just one category for the moment, always rebuilt)
def load(self, category, force=False, y=None):
self.streams[category] = self.update_streams(category)
GenericChannel.load(self, category, force=False, y=y)
|
>
|
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
conf.save(self.module, self.streams, nice=1)
# checks for existence of an URL in bookmarks store,
# this method is called by other channel modules' display() method
def is_in(self, url, once=1):
if (not self.urls):
#@todo: traverse all categories?
self.urls = [str(row.get("url","urn:x-streamtuner2:no")) for row in self.streams["favourite"]]
return str(url) in self.urls
# called from main window / menu / context menu,
# when bookmark is to be added for a selected stream entry
def add(self, row, target="favourite"):
# Add / copy some row attributes
row["favourite"] = 1
if not row.get("favicon"):
pass# row["favicon"] = favicon.file(row.get("homepage"))
if not row.get("listformat"):
row["listformat"] = self.parent.channel().listformat
if not len(row.get("extra", "")):
row["extra"] = self.parent.channel().module
# append to storage
self.streams[target].append(row)
self.save()
self.load(target)
self.urls.append(row["url"])
# simplified gtk TreeStore display logic (just one category for the moment, always rebuilt)
def load(self, category, force=False, y=None):
self.streams[category] = self.update_streams(category)
GenericChannel.load(self, category, force=False, y=y)
|