Ignore:
Timestamp:
03/24/19 08:15:59 (5 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Ran 2to3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/sound.py

    r800 r919  
    11
    2 from util import utf2unicode
     2from .util import utf2unicode
    33
    44import os
     
    113113                    success = True
    114114                    try:
    115                         print "Closing", alias
     115                        print("Closing", alias)
    116116                        self._mci.send("close " + alias)
    117                         print "Closed", alias
    118                     except Exception, e:
    119                         print "Failed closing " + alias + ":",
    120                         print utf2unicode(str(e))
     117                        print("Closed", alias)
     118                    except Exception as e:
     119                        print("Failed closing " + alias + ":", end=' ')
     120                        print(utf2unicode(str(e)))
    121121                        success = False
    122122
     
    130130                    try:
    131131                        alias = "mlxsound%d" % (counter,)
    132                         print "Starting to play", path, "as", alias
     132                        print("Starting to play", path, "as", alias)
    133133                        self._mci.send("open \"%s\" alias %s" % \
    134134                                       (path, alias))
     
    144144                            self._pending.append((timeout, (alias, finishData)))
    145145                            self._pending.sort()
    146                         print "Started to play", path
    147                     except Exception, e:
    148                         print "Failed to start playing " + path + ":",
    149                         print utf2unicode(str(e))
     146                        print("Started to play", path)
     147                    except Exception as e:
     148                        print("Failed to start playing " + path + ":", end=' ')
     149                        print(utf2unicode(str(e)))
    150150                        (finishCallback, extra) = finishData
    151151                        if finishCallback is not None:
     
    220220
    221221            Gst.init(None)
    222         except Exception, e:
     222        except Exception as e:
    223223            outQueue.put(False)
    224224            outQueue.put(e)
     
    351351        else:
    352352            exception = _inQueue.get()
    353             print "The Gst library is missing from your system. It is needed for sound playback on Linux:"
    354             print exception
     353            print("The Gst library is missing from your system. It is needed for sound playback on Linux:")
     354            print(exception)
    355355
    356356    def startSound(name, finishCallback = None, extra = None):
     
    387387
    388388    def callback(result, extra):
    389         print "callback", result, extra
     389        print("callback", result, extra)
    390390
    391391    preInitializeSound()
     
    393393    soundsPath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
    394394                                              "..", "..", "sounds"))
    395     print "soundsPath:", soundsPath
     395    print("soundsPath:", soundsPath)
    396396    initializeSound(soundsPath)
    397397    startSound("notam.mp3", finishCallback = callback, extra= "notam.mp3")
Note: See TracChangeset for help on using the changeset viewer.