Diff
Differences From Artifact [5eb841253c]:
- File channels/__init__.py — part of check-in [9b4d29f9f7] at 2015-04-30 20:33:45 on branch trunk — Temporarily remove iCast plugin from packaging, but add dirble and filtermusic. (user: mario, size: 25322) [annotate] [blame] [check-ins using]
To Artifact [0f18034c13]:
- File
channels/__init__.py
— part of check-in
[5588baf6dd]
at
2015-05-02 05:41:54
on branch trunk
— Implement custom HTML .entitiy_decode, because SAX didn't honor any HTML;
and HTMLParser would require customized/compat2and3 imports.
Colorize channel labels if #color: is specified in any plugins.
And provide @use_rx decorator to alternate between regex/pyquery extractors. (user: mario, size: 26133) [annotate] [blame] [check-ins using]
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + - + | import gtk from uikit import uikit, ver as gtk_ver from config import * import ahttp import action import favicon import os.path |
︙ | |||
573 574 575 576 577 578 579 | 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | - - + + + + + + + + + + | # add prefix: if s.find("/") < 1: s = "audio/" + s # return s # remove SGML/XML entities |
︙ | |||
646 647 648 649 650 651 652 | 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | - + + + + | pixbuf = uikit.pixbuf(png) if pixbuf: icon = gtk.image_new_from_pixbuf(pixbuf) else: icon = gtk.image_new_from_stock(gtk.STOCK_DIRECTORY, size=1) label = gtk.HBox() label.pack_start(icon, expand=False, fill=True) |
︙ | |||
684 685 686 687 688 689 690 691 | 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | + + + + + + + + + + + + + + + | def stub_parent(object): def __setattr__(self, name, value): pass def __getattr__(self, name): return lambda *x: None def status(self, *x): pass # Decorator def use_rx(func): def try_both(*args, **kwargs): for method, use_rx in [("RX", not conf.pyquery), ("PQ", conf.pyquery)]: try: log.STAT(method) return func(*args, use_rx=not conf.pyquery, **kwargs) except Exception as e: log.ERR("{} extraction failed:".format(method), e) continue return [] return try_both |