* examples/ARcue.py:

* examples/gtkcrc.py:
	  Rework both examples to look more similar.
This commit is contained in:
Thomas Vander Stichele
2009-04-12 09:02:25 +00:00
parent d47402af60
commit 07587f51e4
3 changed files with 27 additions and 30 deletions

View File

@@ -1,3 +1,9 @@
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:

View File

@@ -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)

View File

@@ -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]
start = int(sys.argv[2])
end = int(sys.argv[3])
except IndexError:
pass
try:
start = int(sys.argv[2])
except:
pass
try:
end = int(sys.argv[3])
except:
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)