Check-in [7911337325]
Overview
Comment: | more Python3 syntax fixes, introduce compat2and3 module |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | py3 |
Files: | files | file ages | folders |
SHA1: |
7911337325807d54a047947842f1b57a |
User & Date: | mario on 2014-04-08 21:50:21 |
Other Links: | branch diff | manifest | tags |
Context
2014-04-08
| ||
21:53 | fix dict + dict back into list join check-in: d09e020ecf user: mario tags: py3 | |
21:50 | more Python3 syntax fixes, introduce compat2and3 module check-in: 7911337325 user: mario tags: py3 | |
21:16 | rename http to ahttp to avoid conflict with Python3 modules, change .iteritems and xrange, remove same remaining plain print statements check-in: d3b1418bc6 user: mario tags: py3 | |
Changes
Modified ahttp.py from [2dbe950381] to [11eca44aed].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + - - - - - - - - - - - - - - - - - - + - | # # encoding: UTF-8 # api: streamtuner2 # type: functions # title: http download / methods # description: http utility |
︙ |
Modified channels/_generic.py from [5d7f7dc2ae] to [a20153b668].
︙ | |||
179 180 181 182 183 184 185 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - + | # switch stream category, # load data, # update treeview content def load(self, category, force=False): # get data from cache or download |
︙ | |||
233 234 235 236 237 238 239 | 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | - + | # finds differences in new/old streamlist, marks deleted with flag def deleted_streams(self, new, old): diff = [] new = [row.get("url","http://example.com/") for row in new] for row in old: |
︙ |
Modified channels/links.py from [692f83efe7] to [e2e193464a].
︙ | |||
54 55 56 57 58 59 60 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | - + - + | bookmarks = parent.bookmarks if not bookmarks.streams.get(self.module): bookmarks.streams[self.module] = [] bookmarks.add_category(self.module) # collect links from channel plugins |
Modified channels/myoggradio.py from [37210dae1e] to [6c4dac0144].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - + | from channels import * from config import conf from action import action import re import json |
︙ |
Modified channels/shoutcast.py from [0c3da6eedb] to [dd8d75b19e].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - + - + | # sub-categories are queried per 'AJAX' def update_categories(self): html = http.get(self.base_url) self.categories = [] __print__( dbg.DATA, html ) # <h2>Radio Genres</h2> |
︙ |
Modified channels/timer.py from [c50adafaed] to [73a61c99cb].
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + | # # Programmed events are visible in "timer" under the "bookmarks" channel. Times # are stored in the description field, and can thus be edited. However, after editing # times manually, streamtuner2 must be restarted for the changes to take effect. # from config import __print__, dbg from channels import * import kronos from mygtk import mygtk from action import action import copy |
︙ | |||
72 73 74 75 76 77 78 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + | "timer_cancel": lambda w,*a: self.parent.timer_dialog.hide() or 1, }) # prepare spool self.sched = kronos.ThreadedScheduler() for row in self.streams: try: self.queue(row) |
︙ |
Added compat2and3.py version [022ad69c97].
|
Modified favicon.py from [997ecd51ce] to [983556d34c].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | always_google = 1 # use favicon service for speed only_google = 1 # if that fails, try our other/slower methods? delete_google_stub = 1 # don't keep placeholder images google_placeholder_filesizes = (726,896) import os, os.path |
︙ |
Modified kronos.py from [6ae12b7565] to [24a87e43ef].
︙ | |||
270 271 272 273 274 275 276 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | - + | self.sched.queue[:] = [] def _run(self): # Low-level run method to do the actual scheduling loop. while self.running: try: self.sched.run() |
︙ | |||
294 295 296 297 298 299 300 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | - + | self.args=args self.kw=kw def __call__(self, schedulerref): """Execute the task action in the scheduler's thread.""" try: self.execute() |
︙ | |||
462 463 464 465 466 467 468 | 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | - + | self.reschedule(schedulerref()) def threadedcall(self): # This method is run within its own thread, so we have to # do the execute() call and exception handling here. try: self.execute() |
︙ | |||
529 530 531 532 533 534 535 | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | - + | def __call__(self, schedulerref): """Execute the task action in its own process.""" pid = os.fork() if pid == 0: # we are the child try: self.execute() |
︙ |
Modified pq.py from [774d8a07cf] to [9ad9a3d426].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + | try: from pyquery import PyQuery as pq # pq.each_pq = lambda self,func: self.each( lambda i,html: func( pq(html, parser="html") ) ) |
︙ |
Modified st2.py from [1b132a9fda] to [9090947823].
︙ | |||
216 217 218 219 220 221 222 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | - + | "search_google": search.google, "search_cancel": search.cancel, "true": lambda w,*args: True, "streamedit_open": streamedit.open, "streamedit_save": streamedit.save, "streamedit_new": streamedit.new, "streamedit_cancel": streamedit.cancel, |
︙ | |||
521 522 523 524 525 526 527 | 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | - + | gtk.rc_parse(f) pass # end application and gtk+ main loop def gtk_main_quit(self, widget, *x): if conf.auto_save_appstate: |
︙ |