self.parent = parent
self.children = []
self.can_download = False
- self.sort_children = False
def get_children(self):
if not self.children:
options.append((n.title, n))
if not n.can_download:
will_download = False
- if node.sort_children:
- options = natural_sort(options, key=lambda x: x[0])
+ options = natural_sort(options, key=lambda x: x[0])
result = choose(options, allow_multi=will_download)
if result is None:
if node.parent is not None:
Node.__init__(self, title, parent)
self.params = params
self.series_id = series_id
- self.sort_children = True
def fill_children(self):
series_doc = grab_json(self.params["api"] + "series=" + self.series_id, 3600)
class IviewRootNode(Node):
def __init__(self, parent):
Node.__init__(self, "ABC iView", parent)
- self.sort_children = True
def fill_children(self):
config_doc = grab_xml(CONFIG_URL, 24*3600)
cid = category.attrib["id"]
category_name = category.xpath("name/text()")[0]
category_node = Node(category_name, self)
- category_node.sort_children = True
categories_map[cid] = category_node
# Create a duplicate of each series within each category that it appears
def __init__(self, title, parent, url):
Node.__init__(self, title, parent)
self.url = url
- self.sort_children = True
def fill_children(self):
doc = grab_html(self.url, 3600)
class Plus7Root(Node):
def __init__(self, parent=None):
Node.__init__(self, "Yahoo Plus7", parent)
- self.sort_children = True
def fill_children(self):
doc = grab_html(BROWSE, 3600)
def __init__(self, title, parent, url):
Node.__init__(self, title, parent)
self.url = url
- self.sort_children = True
def fill_children(self):
try:
return
node = Node(cat_data["name"], parent)
- self.create_nav_node("Featured", node, cat_data, "furl")
- self.create_nav_node("Latest", node, cat_data, "url")
- self.create_nav_node("Most Popular", node, cat_data, "purl")
+ self.create_nav_node("-Featured", node, cat_data, "furl")
+ self.create_nav_node("-Latest", node, cat_data, "url")
+ self.create_nav_node("-Most Popular", node, cat_data, "purl")
children = cat_data.get("children", [])
if isinstance(children, dict):