def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.action = params.get("action", None)
        # self.sort_method = params.get("sort", control.infoLabel("Container.SortMethod"))
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.browse_url = "%sBrowse/Authors?direction=desc&sort=%s&page=%i&term=%s&%s"
        self.search_term = urllib.unquote_plus(params.get("query", ""))
        self.author_url = urllib.unquote_plus(params.get("author-url", ""))
        utils.set_no_sort()

        if self.action is None or self.action == "browse-authors":
            if self.sort_method == control.lang(30705):  # episodes
                self.sort = "episodes"
            elif self.sort_method == control.lang(30704):  # AtoZ
                self.sort = "atoz"
            else:
                self.show_sort()
                return
            self.browse()
            return
        elif self.action == "search-authors":
            self.sort = ""
            self.search()
            return
        elif self.action == "list-author" and self.author_url != "":
            self.list()
            return

        print "fail: action=%s&sort=%s&author-url=%s" % (self.action, self.sort_method, self.author_url)
        return
Exemplo n.º 2
0
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.action = params.get("action", None)
        # self.sort_method = params.get("sort", control.infoLabel("Container.SortMethod"))
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.blog_url = urllib.unquote_plus(params.get("blog-url", ""))
        self.browse_url = "%s/Browse/Blogs?sort=%s&page=%i&%s"

        utils.set_no_sort()

        if self.action is None or self.action == "browse-blogs":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30704):  # AtoZ
                self.sort = "atoz"
            else:
                self.show_sort()
                return
            self.browse()
        elif self.action == "list-blog" and self.blog_url != "":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30702):  # viewed
                self.sort = "viewed"
            elif self.sort_method == control.lang(30703):  # rating
                self.sort = "rating"
            else:
                self.show_list_sort()
                return
            self.list()
        print "fail: action=%s&blog-url=%s" % (self.action, self.blog_url)
        return
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.action = params.get("action", None)
        # self.sort_method = params.get("sort", control.infoLabel("Container.SortMethod"))
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.blog_url = urllib.unquote_plus(params.get("blog-url", ""))
        self.browse_url = "%s/Browse/Blogs?sort=%s&page=%i&%s"

        utils.set_no_sort()

        if self.action is None or self.action == "browse-blogs":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30704):  # AtoZ
                self.sort = "atoz"
            else:
                self.show_sort()
                return
            self.browse()
        elif self.action == "list-blog" and self.blog_url != "":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30702):  # viewed
                self.sort = "viewed"
            elif self.sort_method == control.lang(30703):  # rating
                self.sort = "rating"
            else:
                self.show_list_sort()
                return
            self.list()
        print "fail: action=%s&blog-url=%s" % (self.action, self.blog_url)
        return
    def __init__(self):
        # params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        # self.action = params.get("action", None)
        utils.set_no_sort()

        meta = utils.get_course_meta()["sections"]
        for m in meta:
            header = m["header"]
            title = header
            if title in utils.ignore_sections:
                continue

            for sid in utils.section_ids:
                if title == control.lang(sid):
                    title = control.lang(sid + 100)
            icon = os.path.join(control.imagesPath, "%s.png" % header)
            utils.add_directory(title, icon, icon,
                                "%s?action=browse-section&section=%s" % (sys.argv[0], urllib.quote_plus(header)))

        utils.add_directory(utils.text_green % control.lang(30501), utils.icon_search, utils.icon_search,
                            "%s?action=search" % sys.argv[0])

        utils.add_directory(utils.text_green % control.lang(30502), utils.icon_settings, None,
                            "%s?action=settings" % (sys.argv[0]))

        control.directory_end()
        return
Exemplo n.º 5
0
 def __init__(self):
     params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
     self.action = params.get("action", 'board')
     self.board = urllib.unquote_plus(params.get("board", ''))
     self.threadId = int(urllib.unquote_plus(params.get("id", '0')))
     utils.set_no_sort()
     self.browse()
     return
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.search_query = params.get("query", '')
        self.search()

        utils.set_no_sort()
        return
Exemplo n.º 7
0
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.search_query = params.get("query", '')
        self.search()

        utils.set_no_sort()
        return
Exemplo n.º 8
0
 def __init__(self):
     params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
     self.action = params.get("action", 'board')
     self.board = urllib.unquote_plus(params.get("board", ''))
     self.page = int(urllib.unquote_plus(params.get("page", '1')))
     self.totalPages = int(urllib.unquote_plus((params.get("total_pages", '10'))))
     utils.set_no_sort()
     self.browse()
     return
 def __init__(self):
     params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
     self.action = params.get("action", 'view-course')
     self.sort_method = params.get("sort", '')
     self.topic_url = urllib.unquote_plus(params.get("url", ''))
     self.course_id = urllib.unquote_plus(params.get("id", None))
     utils.set_no_sort()
     self.browse()
     return
 def __init__(self):
     params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
     self.action = params.get("action", 'view-course')
     self.sort_method = params.get("sort", '')
     self.topic_url = urllib.unquote_plus(params.get("url", ''))
     self.course_id = urllib.unquote_plus(params.get("id", None))
     utils.set_no_sort()
     self.browse()
     return
Exemplo n.º 11
0
    def __init__(self):

        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        utils.set_no_sort()
        self.sort = urllib.unquote_plus(params.get("sort", ''))
        self.page = int(urllib.unquote_plus(params.get("page", '0')))

        if self.sort == '':
            self.display_sort_choice()
        else:
            self.browse_gallery()
        return
Exemplo n.º 12
0
    def __init__(self):
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        album_id = params["id"]
        utils.set_no_sort()
        api = imgur.Api()

        data = api.get_album(album_id)["album"]
        images = data["images"]
        for img in images:
            utils.add_gallery_item(img)

        control.directory_end(force_thumb=True)
        return
Exemplo n.º 13
0
    def render_reddit_list(self):
        utils.set_no_sort()
        epoch_time = int(time.time())
        utils.add_directory(utils.text_green % control.lang(30502), utils.icon_settings, None,
                            "%s?action=settings" % (sys.argv[0]))

        utils.add_directory(utils.text_heading % (control.lang(30508)), utils.icon_folder, None,
                            "%s?action=reddit_add" % (sys.argv[0]))

        reddits = utils.get_subreddits()
        for sr in reddits:
            utils.add_directory(sr.title(), utils.icon_folder, None,
                                "%s%s?action=gallery&section=%s&type=reddit" % (
                                    sys.argv[0], epoch_time, urllib.quote_plus(sr.title())))
        control.directory_end(force_thumb=False)
        return
Exemplo n.º 14
0
    def __init__(self):
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.action = params.get("action", None)
        self.section = urllib.unquote_plus(params.get("section", ''))
        self.group = urllib.unquote_plus(params.get("group", ""))
        self.current_page = int(urllib.unquote_plus(params.get("page", "1")))
        self.per_page = 10

        self.icon = os.path.join(control.imagesPath, "%s.png" % self.section)

        utils.set_no_sort()
        if self.action == 'browse-section':
            self.browse_section()
        elif self.action == "browse-group":
            self.browse_group()
        return
    def __init__(self):
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.action = params.get("action", None)
        self.section = urllib.unquote_plus(params.get("section", ''))
        self.group = urllib.unquote_plus(params.get("group", ""))
        self.current_page = int(urllib.unquote_plus(params.get("page", "1")))
        self.per_page = 10

        self.icon = os.path.join(control.imagesPath, "%s.png" % self.section)

        utils.set_no_sort()
        if self.action == 'browse-section':
            self.browse_section()
        elif self.action == "browse-group":
            self.browse_group()
        return
    def __init__(self):
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.action = params.get("action", None)
        self.section = urllib.unquote_plus(params.get("section", ""))
        self.group = urllib.unquote_plus(params.get("group", ""))
        self.current_page = int(urllib.unquote_plus(params.get("page", "1")))
        self.per_page = 10
        self.search_term = urllib.unquote_plus(params.get("query", ""))

        if self.section != "":
            self.icon = os.path.join(control.imagesPath, "%s.png" % self.section)
        else:
            self.icon = os.path.join(control.imagesPath, "unknown.png")

        utils.set_no_sort()
        if self.action == 'search':
            self.search()
        return
Exemplo n.º 17
0
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.action = params.get("action", None)
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.event_url = urllib.unquote_plus(params.get("event-url", ""))
        self.browse_events_url = "%s/Browse/Events/recent?sort=%s&page=%i&%s"
        self.browse_live_url = "%s/Browse/Events/current?sort=%s&page=%i&%s"

        utils.set_no_sort()

        if self.action is None or self.action == "browse-events":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30704):  # atoz
                self.sort = "atoz"
            else:
                self.show_sort()
                return
            self.browse()
            return
        elif self.action == "browse-live":
            self.sort = "current"
            self.live()
            return
        elif self.action == "list-event":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = ""
            elif self.sort_method == control.lang(30702):  # viewed
                self.sort = "viewed"
            elif self.sort_method == control.lang(30703):  # rating
                self.sort = "rating"
                self.sort_dir = "asc"
            else:
                self.show_list_sort()
                return
            self.list()
            return
        print "fail: action=%s&event-url=%s" % (self.action, self.event_url)
        return
Exemplo n.º 18
0
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.url = "https://channel9.msdn.com/Browse/AllContent?sort=%s&page=%i&%s"

        utils.set_no_sort()

        if self.sort_method == control.lang(30701):  # recent
            self.sort = "recent"
            self.get_entries()
        elif self.sort_method == control.lang(30702):  # viewed
            self.sort = "viewed"
            self.get_entries()
        elif self.sort_method == control.lang(30703):  # rating
            self.sort = "rating"
            self.get_entries()
        else:
            self.browse()
        return
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.url = "https://channel9.msdn.com/Browse/AllContent?sort=%s&page=%i&%s"

        utils.set_no_sort()

        if self.sort_method == control.lang(30701):  # recent
            self.sort = "recent"
            self.get_entries()
        elif self.sort_method == control.lang(30702):  # viewed
            self.sort = "viewed"
            self.get_entries()
        elif self.sort_method == control.lang(30703):  # rating
            self.sort = "rating"
            self.get_entries()
        else:
            self.browse()
        return
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.action = params.get("action", None)
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.event_url = urllib.unquote_plus(params.get("event-url", ""))
        self.browse_url = "%s/Browse/Events?sort=%s&page=%i&%s"

        utils.set_no_sort()

        if self.action is None or self.action == "browse-events":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30704):  # atoz
                self.sort = "atoz"
            else:
                self.show_sort()
                return
            self.browse()
            return
        elif self.action == "browse-live":
            self.sort = "current"
            self.live()
            return
        elif self.action == "list-event":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = ""
            elif self.sort_method == control.lang(30702):  # viewed
                self.sort = "viewed"
            elif self.sort_method == control.lang(30703):  # rating
                self.sort = "rating"
                self.sort_dir = "asc"
            else:
                self.show_list_sort()
                return
            self.list()
            return
        print "fail: action=%s&event-url=%s" % (self.action, self.event_url)
        return
Exemplo n.º 21
0
    def __init__(self):
        utils.set_no_sort()

        utils.add_directory(utils.text_green % control.lang(30502),
                            utils.icon_settings, None,
                            "%s?action=settings" % (sys.argv[0]))

        utils.add_directory(utils.text_heading % (control.lang(30503)),
                            utils.icon_folder, None,
                            "%s?action=gallery" % (sys.argv[0]))

        utils.add_directory(utils.text_heading % control.lang(30504),
                            utils.icon_folder, None,
                            "%s?action=meme" % (sys.argv[0]))
        utils.add_directory(utils.text_heading % control.lang(30505),
                            utils.icon_folder, None,
                            "%s?action=reddit" % (sys.argv[0]))
        utils.add_directory(utils.text_heading % control.lang(30506),
                            utils.icon_folder, None,
                            "%s?action=random" % (sys.argv[0]))

        control.directory_end(force_thumb=False)
        return
    def __init__(self):
        utils.set_no_sort()

        # All
        utils.add_directory(control.lang(30401), utils.icon_all, None,
                            "%s?action=list-all" % (sys.argv[0]))
        # Live
        utils.add_directory(control.lang(30407), utils.icon_event, None,
                            "%s?action=browse-live" % (sys.argv[0]))
        # Events
        utils.add_directory(control.lang(30405), utils.icon_event, None,
                            "%s?action=browse-events" % (sys.argv[0]))
        # Shows
        utils.add_directory(control.lang(30403), utils.icon_tv, None,
                            "%s?action=browse-shows" % (sys.argv[0]))
        # Series
        utils.add_directory(control.lang(30404), utils.icon_tv, None,
                            "%s?action=browse-series" % (sys.argv[0]))
        # Tags
        utils.add_directory(control.lang(30402), utils.icon_tag, None,
                            "%s?action=browse-tags" % (sys.argv[0]))
        # Blogs
        utils.add_directory(control.lang(30406), utils.icon_blog, None,
                            "%s?action=browse-blogs" % (sys.argv[0]))
        # Authors
        utils.add_directory(control.lang(30408), utils.icon_user, None,
                            "%s?action=browse-authors" % (sys.argv[0]))
        # Search
        utils.add_directory(control.lang(30409), utils.icon_search, None,
                            "%s?action=search" % (sys.argv[0]))
        # Search
        utils.add_directory(
            "[B][COLOR green]%s[/COLOR][/B]" % control.lang(30410),
            utils.icon_cog, None, "%s?action=settings" % (sys.argv[0]))

        control.directory_end()
        return
Exemplo n.º 23
0
    def __init__(self):
        utils.set_no_sort()

        # All
        utils.add_directory(control.lang(30401), utils.icon_all, None,
                            "%s?action=list-all" % (sys.argv[0]))
        # Live
        utils.add_directory(control.lang(30407), utils.icon_event, None,
                            "%s?action=browse-live" % (sys.argv[0]))
        # Events
        utils.add_directory(control.lang(30405), utils.icon_event, None,
                            "%s?action=browse-events" % (sys.argv[0]))
        # Shows
        utils.add_directory(control.lang(30403), utils.icon_tv, None,
                            "%s?action=browse-shows" % (sys.argv[0]))
        # Series
        utils.add_directory(control.lang(30404), utils.icon_tv, None,
                            "%s?action=browse-series" % (sys.argv[0]))
        # Tags
        utils.add_directory(control.lang(30402), utils.icon_tag, None,
                            "%s?action=browse-tags" % (sys.argv[0]))
        # Blogs
        utils.add_directory(control.lang(30406), utils.icon_blog, None,
                            "%s?action=browse-blogs" % (sys.argv[0]))
        # Authors
        utils.add_directory(control.lang(30408), utils.icon_user, None,
                            "%s?action=browse-authors" % (sys.argv[0]))
        # Search
        utils.add_directory(control.lang(30409), utils.icon_search, None,
                            "%s?action=search" % (sys.argv[0]))
        # Search
        utils.add_directory("[B][COLOR green]%s[/COLOR][/B]" % control.lang(30410), utils.icon_cog, None,
                            "%s?action=settings" % (sys.argv[0]))

        control.directory_end()
        return
Exemplo n.º 24
0
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.action = params.get("action", None)
        # self.sort_method = params.get("sort", control.infoLabel("Container.SortMethod"))
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.tag_url = urllib.unquote_plus(params.get("tag-url", ""))
        self.browse_url = "%s/Browse/Tags/firstLetter/%s/json"
        self.tag = urllib.unquote_plus(params.get("tag", ""))

        if self.tag == '#':
            self.tag = 'more'

        utils.set_no_sort()

        if self.action is None or self.action == "browse-tags":
            self.tags_alpha()
            return
        elif self.action == "browse-tag-item":
            self.browse()
            return
        elif self.action == "list-tag":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30702):  # viewed
                self.sort = "viewed"
            elif self.sort_method == control.lang(30703):  # rating
                self.sort = "rating"
            else:
                self.show_list_sort()
                return
            self.list()
            return
        print "fail: action=%s&tag-url=%s" % (self.action, self.tag_url)
        return
Exemplo n.º 25
0
    def __init__(self):
        # Parse parameters...
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
        self.current_page = int(params.get("page", "1"))
        self.action = params.get("action", None)
        # self.sort_method = params.get("sort", control.infoLabel("Container.SortMethod"))
        self.sort_method = urllib.unquote_plus(params.get("sort", "NONE"))
        self.tag_url = urllib.unquote_plus(params.get("tag-url", ""))
        self.browse_url = "%s/Browse/Tags/firstLetter/%s/json"
        self.tag = urllib.unquote_plus(params.get("tag", ""))

        if self.tag == '#':
            self.tag = 'more'

        utils.set_no_sort()

        if self.action is None or self.action == "browse-tags":
            self.tags_alpha()
            return
        elif self.action == "browse-tag-item":
            self.browse()
            return
        elif self.action == "list-tag":
            if self.sort_method == control.lang(30701):  # recent
                self.sort = "recent"
            elif self.sort_method == control.lang(30702):  # viewed
                self.sort = "viewed"
            elif self.sort_method == control.lang(30703):  # rating
                self.sort = "rating"
            else:
                self.show_list_sort()
                return
            self.list()
            return
        print "fail: action=%s&tag-url=%s" % (self.action, self.tag_url)
        return