Merge lp:~xzcvczx/novacut/novacut-thumbnailer-changes into lp:novacut

Proposed by xzcvczx
Status: Merged
Merged at revision: 300
Proposed branch: lp:~xzcvczx/novacut/novacut-thumbnailer-changes
Merge into: lp:novacut
Diff against target: 49 lines (+12/-18)
1 file modified
novacut-thumbnailer (+12/-18)
To merge this branch: bzr merge lp:~xzcvczx/novacut/novacut-thumbnailer-changes
Reviewer Review Type Date Requested Status
Jason Gerard DeRose Approve
Review via email: mp+140725@code.launchpad.net

Description of the change

Fixed a spelling mistake in novacut-thumbnailer
Updated novacut-thumbnailer to use argparse

To post a comment you must log in.
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Thanks, looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'novacut-thumbnailer'
2--- novacut-thumbnailer 2012-07-16 17:47:11 +0000
3+++ novacut-thumbnailer 2012-12-19 16:50:27 +0000
4@@ -31,25 +31,19 @@
5 from os import path
6 import json
7 from base64 import b64encode
8-import optparse
9-
10-
11-parser = optparse.OptionParser(
12- usage='%prog FILE_ID [FRAME1...]',
13-)
14-(options, args) = parser.parse_args()
15-
16-
17-if not args:
18- print('takes at least 1 argument FILE_ID')
19- sys.exit(1)
20-_id = args[0]
21-
22-if len(args) == 1:
23+import argparse
24+
25+parser = argparse.ArgumentParser(add_help=False)
26+parser.add_argument('FILE_ID')
27+parser.add_argument('FRAMES', metavar='FRAME', type=int, nargs='*')
28+args = parser.parse_args()
29+
30+_id = args.FILE_ID
31+
32+if not args.FRAMES:
33 frames = [0]
34 else:
35- frames = [int(f) for f in args[1:]]
36-
37+ frames = args.FRAMES
38
39 import dbus
40 import gst
41@@ -211,7 +205,7 @@
42 'data': b64encode(buf.data),
43 }
44 else:
45- print('got buffer for frame we arleady have', frame)
46+ print('got buffer for frame we already have', frame)
47 self.count += 1
48 if frame >= self.frame and self.count >= KEYFRAME:
49 print('done', self.count, frame)

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: