
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.58 KB | hits: 13 | expires: Never
def listStreams(self):
r = "Streams:\n"
c = self.db.cursor()
c.execute('SELECT id, url, type, en, state FROM streams ORDER BY en, id')
for i in c.fetchall():
num = "%05d" % i[0]
if i[3] == 1: en = "+";
else: en = "-"
if i[2] == 1: t = " RSS"
else: t = "PAGE"
url = i[1].encode("utf-8", "ignore")
if i[4]: title = i[4].encode("utf-8", "ignore")
else: title = ""
r = "%s %s[%s] %s: %s - %s\n" % (r, en, num, t, url, title)
return r