diff --git a/fmtools.spec b/fmtools.spec index fe5dac4..c38aeee 100644 --- a/fmtools.spec +++ b/fmtools.spec @@ -3,7 +3,7 @@ Summary: Simple Video for Linux radio card programs Name: fmtools Version: 2.0.1 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ Group: Applications/Multimedia URL: http://benpfaff.org/fmtools @@ -97,10 +97,13 @@ rm -rf %{buildroot} %{_datadir}/%{name}/radio.gif %changelog + +* Sat Feb 26 2011 Paulo Roma 2.0.1-6 +- Ported to python3. + * Tue Feb 08 2011 Fedora Release Engineering - 2.0.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - * Mon Dec 20 2010 Paulo Roma 2.0.1-4 - Condionally build with python-lirc. diff --git a/sources b/sources index 24c3990..db88804 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -377d5015cc65d9c7265e8c3247217927 fmcontrol.tar.gz +5236130b1a178b906fb47d76f3d10149 fmcontrol.tar.gz 5b48f552180f18d46fe92124b2fcfca0 fmtools-2.0.1.tar.gz diff --git a/tkradio.py b/tkradio.py index a188cf7..855d941 100644 --- a/tkradio.py +++ b/tkradio.py @@ -10,11 +10,14 @@ from threading import Thread from subprocess import Popen, PIPE try: - from mtTkinter import * + from tkinter import * # python3 except ImportError: - from Tkinter import * - print ( "mtTkinter not found: http://tkinter.unpythonic.net/wiki/mtTkinter" ) - print ( "Remote control will not work!!" ) + try: + from mtTkinter import * + except ImportError: + from Tkinter import * + print ( "mtTkinter not found: http://tkinter.unpythonic.net/wiki/mtTkinter" ) + print ( "Remote control will not work!!" ) try: import pylirc @@ -30,10 +33,10 @@ try: use_notify = True else: use_notify = False - print "pynotify module initialization failed" + print ( "pynotify module initialization failed" ) except: use_notify = False - print "notify-python not found: http://www.galago-project.org/downloads.php" + print ( "notify-python not found: http://www.galago-project.org/downloads.php" ) # These are stations in the Rio de Janeiro area. # Customize for your own locale. They can be set @@ -130,7 +133,7 @@ class IRRec(Thread): quit() else: # Print all the configs... - print "Command: %s, Repeat: %d" % (code["config"], code["repeat"]) + print ( "Command: %s, Repeat: %d" % (code["config"], code["repeat"]) ) if (not blocking): s = pylirc.nextcode(1) else: @@ -282,7 +285,7 @@ def quit(msg=""): """Quit the radio.""" if ( msg ): - print msg + print (msg) else: radio ("off") # kill all threads @@ -473,8 +476,8 @@ def main (argv=None): if argv is None: argv = sys.argv - pyversion = string.split(sys.version)[0] - print "Python Version: ", pyversion + pyversion = str.split(sys.version)[0] + print ( "Python Version: ", pyversion ) # check whether tkradio is already running stat = os.popen (PS + " aux | " + GREP + " -E \"python(" + pyversion[0:3] + ")? " + argv[0] + "\"").readline() @@ -531,7 +534,7 @@ def main (argv=None): recvar = StringVar() # creates a checkbutton for the alarm state loopvar = StringVar() # creates a checkbutton for the loopback recvar.set ( "OFF" ) - aid = getpid ( string.rsplit(REC,'/',1)[1] ) + aid = getpid ( str.rsplit(REC,'/',1)[1] ) if ( aid ): # is the loop back already on? loopvar.set ( "ON" ) lid = aid @@ -566,5 +569,5 @@ def main (argv=None): try: if __name__=="__main__": sys.exit(main()) -except (KeyboardInterrupt,SystemExit),msg: +except (KeyboardInterrupt,SystemExit) as msg: quit(msg)