[SCM] morituri/master: * examples/ARcue.py: * examples/gtkcrc.py: Rework both examples to look more similar.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:08:45 UTC 2014
The following commit has been merged in the master branch:
commit 07587f51e4ad135b3e6ec21de3297239a513c6ac
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Sun Apr 12 09:02:25 2009 +0000
* examples/ARcue.py:
* examples/gtkcrc.py:
Rework both examples to look more similar.
diff --git a/ChangeLog b/ChangeLog
index d8be26e..27506d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
+ * examples/ARcue.py:
+ * examples/gtkcrc.py:
+ Rework both examples to look more similar.
+
+2009-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
+
* examples/gtkcrc.py:
* morituri/common/task.py:
Move the gtk-based progress bar to task.
diff --git a/examples/ARcue.py b/examples/ARcue.py
index 6e52a5a..4d1f080 100644
--- a/examples/ARcue.py
+++ b/examples/ARcue.py
@@ -20,15 +20,14 @@
# You should have received a copy of the GNU General Public License
# along with morituri. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
-from morituri.image import image
-from morituri.common import task, crc
-
import gobject
gobject.threads_init()
+from morituri.image import image
+from morituri.common import task, crc
+
def main(path):
cueImage = image.Image(path)
diff --git a/examples/gtkcrc.py b/examples/gtkcrc.py
index 69ff99e..66ad29b 100644
--- a/examples/gtkcrc.py
+++ b/examples/gtkcrc.py
@@ -22,9 +22,6 @@
import sys
-import gst
-import time
-
import gobject
gobject.threads_init()
@@ -32,35 +29,30 @@ import gtk
from morituri.common import task, crc
+def main(path, start, end):
+ crctask = crc.CRC32Task(path, start, end)
+
+ window = gtk.Window()
+ progress = task.GtkProgressRunner()
+ progress.connect('stop', lambda _: gtk.main_quit())
+ window.add(progress)
+ window.show_all()
+
+ progress.run(crctask)
+
+ gtk.main()
+
+ print "CRC: %08X" % crctask.crc
+
path = 'test.flac'
start = 0
end = -1
try:
path = sys.argv[1]
-except IndexError:
- pass
-
-try:
start = int(sys.argv[2])
-except:
- pass
-
-try:
end = int(sys.argv[3])
-except:
+except IndexError:
pass
-crctask = crc.CRC32Task(path, start, end)
-
-window = gtk.Window()
-progress = task.GtkProgressRunner()
-progress.connect('stop', lambda _: gtk.main_quit())
-window.add(progress)
-window.show_all()
-
-progress.run(crctask)
-
-gtk.main()
-
-print "CRC: %08X" % crctask.crc
+main(path, start, end)
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list