Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     def listStreams(self):
  2.         r = "Streams:\n"        
  3.         c = self.db.cursor()
  4.         c.execute('SELECT id, url, type, en, state FROM streams ORDER BY en, id')
  5.         for i in c.fetchall():
  6.             num = "%05d" % i[0]
  7.             if i[3] == 1: en = "+";
  8.             else: en = "-"
  9.             if i[2] == 1: t = " RSS"
  10.             else: t = "PAGE"
  11.             url = i[1].encode("utf-8", "ignore")
  12.             if i[4]: title = i[4].encode("utf-8", "ignore")
  13.             else: title = ""
  14.             r = "%s %s[%s] %s: %s - %s\n" % (r, en, num, t, url, title)
  15.         return r