Merge lp:~kerry.hatcher/oggconvert/trunk into lp:oggconvert

Proposed by Kerry Hatcher
Status: Needs review
Proposed branch: lp:~kerry.hatcher/oggconvert/trunk
Merge into: lp:oggconvert
Diff against target: 76 lines (+27/-4)
2 files modified
OggConvert/ocv_main.py (+8/-3)
oggconvert (+19/-1)
To merge this branch: bzr merge lp:~kerry.hatcher/oggconvert/trunk
Reviewer Review Type Date Requested Status
Tristan Brindle Pending
Review via email: mp+26054@code.launchpad.net

Description of the change

I add the ability to set the input file though a command line arg.

ie:

kwhatcher@kwhatcher-desktop:/media/webdata/Projects/oggconvert$ ./oggconvert /home/kwhatcher/Desktop/OilSlick.avi

This is my first time helping write code for a project. Thought I'd start small ;)

I really need OggConvert to work just from the command line, figured this would be the first step.

-Kerry

To post a comment you must log in.

Unmerged revisions

27. By Kerry Hatcher

set selected file at start with command args

26. By Kerry Hatcher <kwhatcher@kwhatcher-desktop>

added command line arg input

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'OggConvert/ocv_main.py'
2--- OggConvert/ocv_main.py 2010-05-23 14:56:10 +0000
3+++ OggConvert/ocv_main.py 2010-05-26 14:20:48 +0000
4@@ -40,7 +40,7 @@
5 from ocv_info import app_name, gladepath, localepath, pixmappath
6
7 class Main:
8- def __init__(self):
9+ def __init__(self, input_file_name):
10
11 # Init the list of languages to support
12 langs = []
13@@ -117,7 +117,7 @@
14 self._container_expander.show()
15 self._container_combobox.show()
16
17- self._set_up_filechooser()
18+ self._set_up_filechooser(input_file_name)
19
20 self._wtree.signal_autoconnect(signals)
21
22@@ -286,7 +286,7 @@
23 def _about(self, button):
24 about_dialogue(self._window)
25
26- def _set_up_filechooser(self):
27+ def _set_up_filechooser(self, start_file_name):
28 video = gtk.FileFilter()
29 video.set_name(_("Video Files"))
30 video.add_mime_type("video/*")
31@@ -307,10 +307,15 @@
32 self._file_chooser_button.add_filter(video)
33 self._file_chooser_button.add_filter(audio)
34 self._file_chooser_button.add_filter(allfiles)
35+
36+ #default_file_selected = os.path.join(os.path.expanduser("~"), "example.avi")
37
38 self._file_chooser_button.set_current_folder(
39 os.path.expanduser("~"))
40
41+ self._file_chooser_button.set_filename(start_file_name)
42+
43+
44 self._file_chooser_button.set_local_only(False)
45
46 def _set_up_liststores(self):
47
48=== modified file 'oggconvert'
49--- oggconvert 2007-11-18 21:22:33 +0000
50+++ oggconvert 2010-05-26 14:20:48 +0000
51@@ -28,6 +28,24 @@
52
53 import OggConvert.ocv_main as OC
54
55-main = OC.Main()
56+import sys
57+
58+input_file = ""
59+
60+try:
61+ input_file = sys.argv[1]
62+except (IndexError):
63+ print "Input file arg is null"
64+
65+
66+
67+
68+#output_file = sys.argv[2]
69+
70+
71+
72+main = OC.Main(input_file)
73+
74+
75
76 gtk.main()

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: