]>
code.delx.au - webdl/blob - grabber.py
2 # vim:ts=4:sts=4:sw=4:noet
4 from common
import load_root_node
7 def choose(options
, allow_multi
):
8 skeys
= sorted(options
.keys())
9 for i
, key
in enumerate(skeys
):
10 print " %d) %s" % (i
+1, key
)
14 values
= map(int, raw_input("Choose> ").split())
19 values
= [options
[skeys
[value
-1]] for value
in values
]
25 except ValueError, IndexError:
26 print >>sys
.stderr
, "Invalid input, please try again"
30 print "Loading episode data...",
32 node
= load_root_node()
37 for n
in node
.children
:
39 if not n
.can_download
:
41 result
= choose(options
, allow_multi
=will_download
)
43 if node
.parent
is not None:
50 raw_input("Press return to continue...\n")
54 if __name__
== "__main__":
57 except (KeyboardInterrupt, EOFError):