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
|
# done
def hide(self, *w):
return self.parent.timer_dialog.hide()
# close dialog,get data
def add_timer(self, *w):
row = self.parent.row()
row = copy.copy(row)
# basic check for consistency
if not re.match("^(\w{2,3}|\*|,)+\s+(\d+:\d+[-.\d+:]*)\s+(record|play)", row[self.timefield]):
self.parent.status("⛔ Danger, Will Robinson! → The given timer date/action is likely invalid. Entry not saved.", timeout=22)
return
self.parent.timer_dialog.hide()
# add data
row["listformat"] = "href" #self.parent.channel().listformat
if row.get(self.timefield):
row["title"] = row["title"] + " -- " + row[self.timefield]
row[self.timefield] = self.parent.timer_value.get_text()
# store
self.save_timer(row)
# store row in timer database
def save_timer(self, row):
self.streams.append(row)
self.bookmarks.save()
self.queue(row)
|
|
<
|
>
>
>
|
>
|
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
|
# done
def hide(self, *w):
return self.parent.timer_dialog.hide()
# close dialog,get data
def add_timer(self, *w):
timespec = self.parent.timer_value.get_text()
# basic check for consistency
if not re.match("^(\w{2,3}|\*|,)+\s+(\d+:\d+[-.\d+:]*)\s+(record|play)", timespec):
self.parent.status("⛔ Danger, Will Robinson! → The given timer date/action is likely invalid. Entry not saved.", timeout=22)
return
# hide dialog
self.parent.timer_dialog.hide()
row = self.parent.row()
row = copy.copy(row)
# add data
row["listformat"] = "href" #self.parent.channel().listformat
if row.get(self.timefield):
row["title"] = row["title"] + " -- " + row[self.timefield]
row[self.timefield] = timespec
# store
self.save_timer(row)
self.parent.status("Timer saved.")
# store row in timer database
def save_timer(self, row):
self.streams.append(row)
self.bookmarks.save()
self.queue(row)
|