21
for s in string.split(interval, ","):
22
if not string.strip(s):
23
for s in interval.split(","):
31
i = string.find(s, "-")
32
lo, hi = string.atoi(s[:i]), string.atoi(s[i+1:])
34
lo, hi = int(s[:i]), int(s[i+1:])
34
36
self.hilo.append((hi, lo))
37
self.hilo = [(sys.maxint, 0)]
39
self.hilo = [(sys.maxsize, 0)]
39
41
def __getitem__(self, index):
55
57
if not sys.argv[2:]:
57
print "Syntax: python explode.py infile template [range]"
59
print "The template argument is used to construct the names of the"
60
print "individual frame files. The frames are numbered file001.ext,"
61
print "file002.ext, etc. You can insert %d to control the placement"
62
print "and syntax of the frame number."
64
print "The optional range argument specifies which frames to extract."
65
print "You can give one or more ranges like 1-10, 5, -15 etc. If"
66
print "omitted, all frames are extracted."
59
print("Syntax: python explode.py infile template [range]")
61
print("The template argument is used to construct the names of the")
62
print("individual frame files. The frames are numbered file001.ext,")
63
print("file002.ext, etc. You can insert %d to control the placement")
64
print("and syntax of the frame number.")
66
print("The optional range argument specifies which frames to extract.")
67
print("You can give one or more ranges like 1-10, 5, -15 etc. If")
68
print("omitted, all frames are extracted.")
69
71
infile = sys.argv[1]
70
72
outfile = sys.argv[2]
72
frames = Interval(string.join(sys.argv[3:], ","))
74
frames = Interval(",".join(sys.argv[3:]))
75
77
# check if outfile contains a placeholder