Changeset 2680

Show
Ignore:
Timestamp:
03/27/17 02:52:30 (4 months ago)
Author:
jwoithe
Message:

python: replace all "print ..." statements with "print( ... )", which is
compatible with current versions of python2 and python3. The replacement
was done with a straight-forward shell command:

for i in $(find . -name \*.py) ; do

sed -i.bak 's/print \(.*\)/print( \1 )/' $i ;

done

This will fail if any of the print statements extend beyond a single line.
Inspection suggests there are none of these, but there is always a chance
that one or two have been missed. If so they can obviously be fixed up
later.

The move to the new "print" syntax was included in Xavier Forestier's
November 2016 patch set. The majority of the changes needed to make FFADO
run under python3 involved fixing the "print" syntax. Other issues
identified in that patch set will be dealt with in future patches.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado/configuration.py

    r1934 r2680  
    143143            token = self.lex.get_token() 
    144144            if token in ("=",":"): 
    145                 #print "%sWill parse value" % level 
     145                #print( "%sWill parse value" % level ) 
    146146                value = self.parsevalue( level ) 
    147147                return (name,value) 
     
    161161    devs = DeviceList( file ) 
    162162 
    163     print devs.devices 
     163    print( devs.devices ) 
    164164 
    165165# vim: et 
  • trunk/libffado/support/mixer-qt4/ffado/ffadowindow.py

    r2678 r2680  
    177177        # Lock acquired 
    178178    except socket.error: 
    179         print 'ffado-mixer instance is already running' 
     179        print( 'ffado-mixer instance is already running' ) 
    180180        sys.exit() 
    181181 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/generic_dice_eap.py

    r2653 r2680  
    3939 
    4040    def buildMixer(self): 
    41         #print self.hw 
    42         #print self.hw.getText("/Generic/Nickname"
     41        #print( self.hw ) 
     42        #print( self.hw.getText("/Generic/Nickname")
    4343        self.mixer = MatrixMixer(self.hw.servername, self.hw.basepath+"/EAP/MatrixMixer", self, "Columns_are_outputs", -1, None, None, False, QTabWidget.North, QTabWidget.Rounded) 
    4444        self.tabs.addTab(self.mixer, "Mixer") 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/globalmixer.py

    r2675 r2680  
    127127 
    128128    def initValues( self ): 
    129         #print "GlobalMixer::initValues()" 
     129        #print( "GlobalMixer::initValues()" ) 
    130130        nb_clocks = self.clockselect.count() 
    131131        for i in range( nb_clocks ): 
     
    202202            idx = readString.index('<nickname>') 
    203203        except Exception: 
    204             print "No nickname found" 
     204            print( "No nickname found" ) 
    205205            idx = -1 
    206206        if idx >= 0: 
     
    214214            idx = readString.index('<clock>') 
    215215        except Exception: 
    216             print "No clock found" 
     216            print( "No clock found" ) 
    217217            idx = -1 
    218218        if idx >= 0: 
     
    225225                idxclock = clockLabel.index(clock) 
    226226            except Exception: 
    227                 print "No %s clock found" % clock 
     227                print( "No %s clock found" % clock ) 
    228228                idxclock = -1 
    229229            if idxclock >= 0: 
     
    236236            idx = readString.index('<samplerate>') 
    237237        except Exception: 
    238             print "Samplerate not found" 
     238            print( "Samplerate not found" ) 
    239239            idx = -1 
    240240        if idx >= 0: 
     
    247247                idxsrate = srateLabel.index(samplerate) 
    248248            except Exception: 
    249                 print "No %s samplerate found" % samplerate 
     249                print( "No %s samplerate found" % samplerate ) 
    250250                idxsrate = -1 
    251251            if idxsrate >= 0: 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/profire2626.py

    r2670 r2680  
    7272 
    7373    def buildMixer(self): 
    74         #print self.hw 
    75         #print self.hw.getText("/Generic/Nickname"
     74        #print( self.hw ) 
     75        #print( self.hw.getText("/Generic/Nickname")
    7676        Generic_Dice_EAP.buildMixer(self) 
    7777 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/rme.py

    r2658 r2680  
    436436    def initValues(self): 
    437437 
    438         # print self.hw.servername 
    439         # print self.hw.basepath 
     438        # print( self.hw.servername ) 
     439        # print( self.hw.basepath ) 
    440440        self.inputmatrix = MatrixMixer(self.hw.servername, self.hw.basepath+"/Mixer/InputFaders", self, "Columns_are_inputs", 0x8000, self.hw.basepath+"/Mixer/InputMutes", self.hw.basepath+"/Mixer/InputInverts", True) 
    441441        layout = QVBoxLayout() 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/saffire_dice.py

    r2676 r2680  
    7373 
    7474    def buildMixer(self): 
    75         #print self.hw 
    76         #print self.hw.getText("/Generic/Nickname"
     75        #print( self.hw ) 
     76        #print( self.hw.getText("/Generic/Nickname")
    7777        Generic_Dice_EAP.buildMixer(self) 
    7878 
     
    9494                ModelName += "_" 
    9595            ModelName += ModelNum 
    96             print ModelName 
     96            print( ModelName ) 
    9797 
    9898        if  ModelName == "SAFFIRE_PRO_14": 
  • trunk/libffado/support/mixer-qt4/ffado/panelmanager.py

    r2670 r2680  
    216216 
    217217    def removePanel(self, guid): 
    218         print "Removing widget for device" + guid 
     218        print( "Removing widget for device" + guid ) 
    219219        w = self.panels[guid] 
    220220        del self.panels[guid] # remove from the list 
     
    492492          f = open(savefilename, 'w') 
    493493        except IOError: 
    494           print "Unable to open save file" 
     494          print( "Unable to open save file" ) 
    495495          return 
    496496        for s in saveString: 
     
    503503          f = open(readfilename, 'r') 
    504504        except IOError: 
    505           print "Unable to open file" 
     505          print( "Unable to open file" ) 
    506506          return 
    507507        log.debug("Opening file %s" % readfilename) 
     
    514514        # It must start with the <?xml ... tag as the first string 
    515515        if readString[0].find("<?xml") == -1: 
    516             print "Not an xml data file" 
     516            print( "Not an xml data file" ) 
    517517            return 
    518518        # Then there must be a file version tag somewhere in the file 
     
    520520            idx = readString.index('<fileversion>') 
    521521        except Exception: 
    522             print "Data file should contain the version tag" 
     522            print( "Data file should contain the version tag" ) 
    523523            return 
    524524        if readString[idx+1].find("<major>") == -1: 
    525             print "Incompatible versioning of the file" 
     525            print( "Incompatible versioning of the file" ) 
    526526        if readString[idx+3].find("</major>") == -1: 
    527             print "Not a valid xml file" 
     527            print( "Not a valid xml file" ) 
    528528        if readString[idx+4].find("<minor>") == -1: 
    529             print "Incompatible versioning of the file" 
     529            print( "Incompatible versioning of the file" ) 
    530530        if readString[idx+6].find("</minor>") == -1: 
    531             print "Not a valid xml file" 
     531            print( "Not a valid xml file" ) 
    532532        version_major = readString[idx+2] 
    533533        version =  version_major + '.' + readString[idx+5] 
     
    535535        # File version newer than present 
    536536        if int(version_major) > int(str(FILE_VERSION).split('.')[0]): 
    537             print "File version is too recent: you should upgrade your FFADO installation" 
     537            print( "File version is too recent: you should upgrade your FFADO installation" ) 
    538538            return 
    539539        # FIXME At a time it will be necessary to detect if an older major version is detected 
     
    546546        n  = readString.count('</device>'); 
    547547        if n != nd: 
    548             print "Not a regular xml file: opening device tag must match closing ones" 
     548            print( "Not a regular xml file: opening device tag must match closing ones" ) 
    549549            return 
    550550        while nd > 0: 
     
    552552          idxe = readString.index('</device>') 
    553553          if idxe < idxb+1: 
    554             print "Not a regular xml file: data must be enclosed between a <device> and </device> tag" 
     554            print( "Not a regular xml file: data must be enclosed between a <device> and </device> tag" ) 
    555555            return 
    556556          stringDev = [] 
     
    561561              idx = stringDev.index('<guid>') 
    562562          except Exception: 
    563               print "Device guid not found" 
     563              print( "Device guid not found" ) 
    564564              return 
    565565          guid = stringDev[idx+1] 
  • trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py

    r2670 r2680  
    170170 
    171171    def __del__(self): 
    172         print "CrossbarRouter.__del__()" 
     172        print( "CrossbarRouter.__del__()" ) 
    173173        self.settings.setValue("crossbarrouter/runvu", self.vubtn.isChecked()) 
    174174 
  • trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py

    r2679 r2680  
    7373 
    7474    def getColor(self, n): 
    75         #print "ColorForNumber.getColor( %g )" % (n
     75        #print( "ColorForNumber.getColor( %g )" % (n)
    7676        keys = sorted(self.colors.keys()) 
    7777        low = keys[-1] 
     
    8181                low = keys[i] 
    8282                high = keys[i+1] 
    83         #print "%g is between %g and %g" % (n, low, high
     83        #print( "%g is between %g and %g" % (n, low, high)
    8484        f = 0 
    8585        if high != low: 
  • trunk/libffado/support/tools/ffado-sandbox-install.py

    r1499 r2680  
    7474 
    7575    if source_descriptor[1] == 'svn': 
    76         print " Checking out SVN repository: %s" % source_descriptor[2] 
     76        print( " Checking out SVN repository: %s" % source_descriptor[2] ) 
    7777        cwd = os.getcwd() 
    7878        os.chdir(build_dir) 
     
    8080        os.chdir(cwd) 
    8181        if retval: 
    82             print "  Failed to checkout the SVN repository. Inspect %s for details. (is subversion installed?)" % logfile 
     82            print( "  Failed to checkout the SVN repository. Inspect %s for details. (is subversion installed?)" % logfile ) 
    8383            return False 
    8484        return True 
    8585    elif source_descriptor[1] == 'tar.gz': 
    86         print " Downloading tarball: %s" % source_descriptor[2] 
     86        print( " Downloading tarball: %s" % source_descriptor[2] ) 
    8787        import urllib 
    8888        tmp_file = '%s/tmp.tar.gz' % build_dir 
     
    9090            urllib.urlretrieve(source_descriptor[2], tmp_file) 
    9191        except: 
    92             print " Could not retrieve source tarball." 
     92            print( " Could not retrieve source tarball." ) 
    9393            return False 
    9494        cwd = os.getcwd() 
    9595        os.chdir(build_dir) 
    96         print " extracting tarball..." 
     96        print( " extracting tarball..." ) 
    9797        retval = os.system('tar -zxf "%s" > %s' % (tmp_file, logfile)) 
    9898        if retval: 
    99             print "  Failed to extract the source tarball. Inspect %s for details." % logfile 
     99            print( "  Failed to extract the source tarball. Inspect %s for details." % logfile ) 
    100100            os.chdir(cwd) 
    101101            return False 
     
    103103            retval = os.system('mv "%s" "%s"' % (source_descriptor[3], target)) 
    104104            if retval: 
    105                 print "  Failed to move the extracted tarball" 
     105                print( "  Failed to move the extracted tarball" ) 
    106106                os.chdir(cwd) 
    107107                return False 
     
    109109        return True 
    110110    else: 
    111         print "bad source type" 
     111        print( "bad source type" ) 
    112112        return False 
    113113 
     
    134134""" 
    135135 
    136 print welcome_msg 
     136print( welcome_msg ) 
    137137 
    138138# get the paths to be used 
     
    180180""" % suggestion_build 
    181181 
    182 print sandbox_dir_msg 
     182print( sandbox_dir_msg ) 
    183183sandbox_dir = ask_for_dir('sandbox', suggestion_sandbox) 
    184184if sandbox_dir == None: 
    185     print "Cannot proceed without valid sandbox directory." 
     185    print( "Cannot proceed without valid sandbox directory." ) 
    186186    exit(-1) 
    187187print(" using %s as sandbox directory" % sandbox_dir) 
    188188 
    189189 
    190 print build_dir_msg 
     190print( build_dir_msg ) 
    191191build_dir = ask_for_dir('build', suggestion_build) 
    192192if build_dir == None: 
    193     print "Cannot proceed without valid build directory." 
     193    print( "Cannot proceed without valid build directory." ) 
    194194    exit(-1) 
    195195print(" using %s as build directory" % build_dir) 
     
    210210    ffado_versions_msg += " %2s: %s\n" % (key, ffado_versions[key][0]) 
    211211 
    212 print ffado_versions_msg 
     212print( ffado_versions_msg ) 
    213213while True: 
    214214    ffado_version = raw_input("Please select a FFADO version: ") 
     
    220220        yesno = raw_input("Invalid FFADO version specified. Try again? [yes/no] ") 
    221221        if yesno == "" or yesno[0] != 'y': 
    222             print "Cannot proceed without valid FFADO version." 
     222            print( "Cannot proceed without valid FFADO version." ) 
    223223            exit(-1) 
    224224        else: 
     
    240240    jack_versions_msg += " %2s: %s\n" % (key, jack_versions[key][0]) 
    241241 
    242 print jack_versions_msg 
     242print( jack_versions_msg ) 
    243243while True: 
    244244    jack_version = raw_input("Please select a jack version: ") 
     
    250250        yesno = raw_input("Invalid jack version specified. Try again? [yes/no] ") 
    251251        if yesno == "" or yesno[0] != 'y': 
    252             print "Cannot proceed without valid jack version." 
     252            print( "Cannot proceed without valid jack version." ) 
    253253            exit(-1) 
    254254        else: 
     
    258258use_jack_version = jack_versions[jack_version_int] 
    259259 
    260 # print a summary 
    261 print """ 
     260# print( a summary ) 
     261print( """ ) 
    262262SUMMARY 
    263263======= 
     
    270270 
    271271# get the ffado source 
    272 print "Fetching FFADO source..." 
     272print( "Fetching FFADO source..." ) 
    273273 
    274274if not fetch_source(build_dir, use_ffado_version, 'libffado'): 
    275     print "Could not fetch FFADO source" 
    276     exit(-1) 
    277 print " Successfully fetched FFADO source" 
    278  
    279 print "Fetching jack source..." 
     275    print( "Could not fetch FFADO source" ) 
     276    exit(-1) 
     277print( " Successfully fetched FFADO source" ) 
     278 
     279print( "Fetching jack source..." ) 
    280280 
    281281if not fetch_source(build_dir, use_jack_version, 'jack'): 
    282     print "Could not fetch jack source" 
    283     exit(-1) 
    284 print " Successfully fetched jack source" 
     282    print( "Could not fetch jack source" ) 
     283    exit(-1) 
     284print( " Successfully fetched jack source" ) 
    285285 
    286286cwd = os.getcwd() 
     
    292292# configure FFADO 
    293293os.chdir("%s/libffado/" % build_dir) 
    294 print "Building FFADO..." 
    295 print " Compiling..." 
     294print( "Building FFADO..." ) 
     295print( " Compiling..." ) 
    296296retval = os.system('scons PREFIX="%s" %s >> %s' % (sandbox_dir, ffado_scons_options, ffado_log)) 
    297297if retval: 
    298     print """ 
     298    print( """ ) 
    299299Failed to configure/build FFADO. Most likely this is due to uninstalled dependencies. 
    300300Check %s for details. 
     
    303303 
    304304# install FFADO 
    305 print " Installing into %s..." % sandbox_dir 
     305print( " Installing into %s..." % sandbox_dir ) 
    306306retval = os.system('scons install >> %s' % (ffado_log)) 
    307307if retval: 
    308     print "Failed to install FFADO. Check %s for details." % ffado_log 
     308    print( "Failed to install FFADO. Check %s for details." % ffado_log ) 
    309309    exit(-1) 
    310310 
     
    314314os.system('echo "" > %s' % jack_log)  
    315315 
    316 print "Building Jack..." 
     316print( "Building Jack..." ) 
    317317if use_jack_version[1] == 'svn': 
    318     print " Initializing build system..." 
     318    print( " Initializing build system..." ) 
    319319    retval = os.system('./autogen.sh >> %s' % jack_log) 
    320320    if retval: 
    321         print """ 
     321        print( """ ) 
    322322Failed to initialize the jack build system. Most likely this is due to uninstalled dependencies. 
    323323Check %s for details. 
     
    325325        exit(-1) 
    326326 
    327 print " Configuring build..." 
     327print( " Configuring build..." ) 
    328328retval = os.system('./configure --prefix="%s" >> %s' % (sandbox_dir, jack_log)) 
    329329if retval: 
    330     print """ 
     330    print( """ ) 
    331331Failed to configure the jack build. Most likely this is due to uninstalled dependencies. 
    332332Check %s for details. 
     
    335335 
    336336# build and install jack 
    337 print " Compiling..." 
     337print( " Compiling..." ) 
    338338retval = os.system('make >> %s' % (jack_log)) 
    339339if retval: 
    340     print "Failed to build jack. Check %s for details." % jack_log 
    341     exit(-1) 
    342  
    343 print " Installing into %s..." % sandbox_dir 
     340    print( "Failed to build jack. Check %s for details." % jack_log ) 
     341    exit(-1) 
     342 
     343print( " Installing into %s..." % sandbox_dir ) 
    344344retval = os.system('make install >> %s' % (jack_log)) 
    345345if retval: 
    346     print "Failed to install jack. Check %s for details." % jack_log 
     346    print( "Failed to install jack. Check %s for details." % jack_log ) 
    347347    exit(-1) 
    348348 
     
    361361""" % (sandbox_dir, sandbox_dir, sandbox_dir) 
    362362 
    363 print "Writing shell configuration file..." 
     363print( "Writing shell configuration file..." ) 
    364364sandbox_rc_file = "%s/ffado.rc" % sandbox_dir 
    365365try: 
     
    368368    fid.close() 
    369369except: 
    370     print "Could not write the sandbox rc file." 
     370    print( "Could not write the sandbox rc file." ) 
    371371    exit(-1) 
    372372 
    373373os.chdir(cwd) 
    374374 
    375 print """ 
     375print( """ ) 
    376376FFADO and jack are installed into %s. If you want to use the 
    377377versions in the sandbox, you have to alter your environment 
  • trunk/libffado/support/tools/ffado_diag_helpers.py

    r2148 r2680  
    163163            tmp 
    164164            cmd = lspci_cmd + " -vv -nn -s %s" % tmp[0] 
    165             print run_command(cmd
     165            print( run_command(cmd)
    166166 
    167167def get_juju_permissions(): 
  • trunk/libffado/support/tools/helpstrings.py

    r2053 r2680  
    5656 
    5757    def show(self, sid): 
    58         print self.get(sid
     58        print( self.get(sid)
    5959     
  • trunk/libffado/support/tools/listirqinfo.py

    r2149 r2680  
    158158if __name__== '__main__': 
    159159 
    160     print "" 
    161     print "Interrupt list utility " + LISTIRQINFO_VERSION 
    162     print "==========================" 
    163     print "(C) 2008 Pieter Palmers" 
    164     print "" 
     160    print( "" ) 
     161    print( "Interrupt list utility " + LISTIRQINFO_VERSION ) 
     162    print( "==========================" ) 
     163    print( "(C) 2008 Pieter Palmers" ) 
     164    print( "" ) 
    165165     
    166166    info = IRQInfo() 
    167167 
    168168    info.load() 
    169     print str(info
     169    print( str(info)
    170170     
    171     print "" 
     171    print( "" ) 
  • trunk/libffado/tests/dbus_test.py

    r1336 r2680  
    4545                dev_cont.setValueIdx(idx,v) 
    4646        except: 
    47             print "Failed to set Continuous %s on server %s" % (path, self.servername
     47            print( "Failed to set Continuous %s on server %s" % (path, self.servername)
    4848 
    4949    def getContignuous(self, subpath, idx=None): 
     
    5757                return dev_cont.getValueIdx(idx) 
    5858        except: 
    59             print "Failed to get Continuous %s on server %s" % (path, self.servername
     59            print( "Failed to get Continuous %s on server %s" % (path, self.servername)
    6060            return 0 
    6161 
     
    6767            dev_cont.setValue(v) 
    6868        except: 
    69             print "Failed to set Discrete %s on server %s" % (path, self.servername
     69            print( "Failed to set Discrete %s on server %s" % (path, self.servername)
    7070 
    7171    def getDiscrete(self, subpath): 
     
    7676            return dev_cont.getValue() 
    7777        except: 
    78             print "Failed to get Discrete %s on server %s" % (path, self.servername
     78            print( "Failed to get Discrete %s on server %s" % (path, self.servername)
    7979            return 0 
    8080 
     
    8686            dev_cont.setValue(address, value) 
    8787        except: 
    88             print "Failed to set Register %s on server %s" % (path, self.servername
     88            print( "Failed to set Register %s on server %s" % (path, self.servername)
    8989 
    9090    def getRegister(self, subpath, address): 
     
    9595            return dev_cont.getValue(address) 
    9696        except: 
    97             print "Failed to get Register %s on server %s" % (path, self.servername
     97            print( "Failed to get Register %s on server %s" % (path, self.servername)
    9898            return 0 
    9999 
     
    105105            dev_cont.setValue(v) 
    106106        except: 
    107             print "Failed to set Text %s on server %s" % (path, self.servername
     107            print( "Failed to set Text %s on server %s" % (path, self.servername)
    108108 
    109109    def getText(self, subpath): 
     
    114114            return dev_cont.getValue() 
    115115        except: 
    116             print "Failed to get Text %s on server %s" % (path, self.servername
     116            print( "Failed to get Text %s on server %s" % (path, self.servername)
    117117            return 0 
    118118 
     
    124124            dev_cont.setValue(row, col, v) 
    125125        except: 
    126             print "Failed to set MatrixMixer %s on server %s" % (path, self.servername
     126            print( "Failed to set MatrixMixer %s on server %s" % (path, self.servername)
    127127 
    128128    def getMatrixMixerValue(self, subpath, row, col): 
     
    133133            return dev_cont.getValue(row, col) 
    134134        except: 
    135             print "Failed to get MatrixMixer %s on server %s" % (path, self.servername
     135            print( "Failed to get MatrixMixer %s on server %s" % (path, self.servername)
    136136            return 0 
    137137 
     
    143143            dev_cont.select(v) 
    144144        except: 
    145             print "Failed to select %s on server %s" % (path, self.servername
     145            print( "Failed to select %s on server %s" % (path, self.servername)
    146146 
    147147    def enumSelected(self, subpath): 
     
    152152            return dev_cont.selected() 
    153153        except: 
    154             print "Failed to get selected enum %s on server %s" % (path, self.servername
     154            print( "Failed to get selected enum %s on server %s" % (path, self.servername)
    155155            return 0 
    156156 
     
    162162            return dev_cont.getEnumLabel(v) 
    163163        except: 
    164             print "Failed to get enum label %s on server %s" % (path, self.servername
     164            print( "Failed to get enum label %s on server %s" % (path, self.servername)
    165165            return 0 
    166166 
     
    172172            return dev_cont.count() 
    173173        except: 
    174             print "Failed to get enum count %s on server %s" % (path, self.servername
     174            print( "Failed to get enum count %s on server %s" % (path, self.servername)
    175175            return 0 
    176176 
     
    191191 
    192192    #def updateSignal(self): 
    193         #print ("Received update signal"
     193        #print( ("Received update signal")
    194194 
    195195    def getNbDevices(self): 
     
    257257if __name__ == "__main__": 
    258258 
    259     print """ 
     259    print( """ ) 
    260260=========================================================== 
    261261FFADO DBUS TEST TOOL 
     
    273273            repeat -= 1 
    274274        except dbus.DBusException, ex: 
    275             print "\n" 
    276             print "===========================================================" 
    277             print "ERROR: Could not communicate with the FFADO DBus service..." 
    278             print "===========================================================" 
    279             print "\n" 
     275            print( "\n" ) 
     276            print( "===========================================================" ) 
     277            print( "ERROR: Could not communicate with the FFADO DBus service..." ) 
     278            print( "===========================================================" ) 
     279            print( "\n" ) 
    280280            sys.exit( -1 ) 
    281281 
    282282    if nbDevices == 0: 
    283         print "No supported device found..." 
     283        print( "No supported device found..." ) 
    284284        sys.exit( -1 ) 
    285285 
     
    287287 
    288288    path=devmgr.getDeviceName(idx) 
    289     print "Found device %d: %s" % (idx, path
     289    print( "Found device %d: %s" % (idx, path)
    290290 
    291291    cfgrom = ConfigRomInterface(server, basepath+'/DeviceManager/'+path) 
     
    296296    vendorName = cfgrom.getVendorName() 
    297297    modelName = cfgrom.getModelName() 
    298     print " Found (%s, %X, %X) %s %s" % (str(GUID), vendorId, modelId, vendorName, modelName
     298    print( " Found (%s, %X, %X) %s %s" % (str(GUID), vendorId, modelId, vendorName, modelName)
    299299 
    300300    # create a control objects 
     
    311311            oldval = register[regid] 
    312312            if newval != oldval: 
    313                 print "%04d: from %8d | %08X to %8d | %08X" % (regid, oldval, oldval, newval, newval
     313                print( "%04d: from %8d | %08X to %8d | %08X" % (regid, oldval, oldval, newval, newval)
    314314                register[regid] = newval 
    315315            time.sleep(0.2) 
    316         print "--- %d ---" % i 
     316        print( "--- %d ---" % i ) 
    317317        #time.sleep(1) 
    318318 
    319319    #regid=eval(sys.argv[1]) 
    320320    #val=eval(sys.argv[2]) 
    321     #print hw.getRegister("/Register", regid
     321    #print( hw.getRegister("/Register", regid)
    322322    #hw.setRegister("/Register", regid, val) 
    323323     
  • trunk/libffado/tests/python/test-eap-ctrl.py

    r1630 r2680  
    3939#nboutputs = mixer.getColCount() 
    4040 
    41 #print nbinputs 
    42 #print nboutputs 
     41#print( nbinputs ) 
     42#print( nboutputs ) 
    4343 
    4444#for i in range(nbinputs): 
     
    5050    #srcidx = router.getSourceIndex(src) 
    5151    #for dst in dsts: 
    52         #print dst 
     52        #print( dst ) 
    5353        #dstidx = router.getDestinationIndex(dst) 
    5454     
     
    6161        ## connect 
    6262        #if router.canConnect(srcidx, dstidx): 
    63             #print router.getConnectionState(srcidx, dstidx
    64             #print router.setConnectionState(srcidx, dstidx, 1
     63            #print( router.getConnectionState(srcidx, dstidx)
     64            #print( router.setConnectionState(srcidx, dstidx, 1)
    6565 
    6666#reroute("InS1:02", ["InS0:00", "InS1:00", "InS1:02", "InS1:04", "InS1:06"]) 
     
    9898    s += "\n" 
    9999 
    100 print s 
     100print( s ) 
  • trunk/libffado/tests/python/test-echo-digital.py

    r2390 r2680  
    3737                                dbus_interface='org.ffado.Control.Element.Discrete') 
    3838except: 
    39         print "'ffado-dbus-server' should be started in advance." 
     39        print( "'ffado-dbus-server' should be started in advance." ) 
    4040        sys.exit() 
    4141 
     
    4545                raise Exception() 
    4646except: 
    47         print "Your device just supports coaxial digital interface." 
     47        print( "Your device just supports coaxial digital interface." ) 
    4848        sys.exit() 
    4949 
     
    5656 
    5757if (argc > 2): 
    58         print "too many arguments" 
     58        print( "too many arguments" ) 
    5959        sys.exit() 
    6060elif (argc > 1): 
    6161        param = int(argvs[1]) 
    6262        if ((param == 1) or (param > 3)): 
    63                 print "wrong argument. it should be:" 
    64                 print "\t0(S/PDIF coaxial), 2(S/PDIF optical), or 3(ADAT optical)" 
     63                print( "wrong argument. it should be:" ) 
     64                print( "\t0(S/PDIF coaxial), 2(S/PDIF optical), or 3(ADAT optical)" ) 
    6565        else: 
    66                 print interface.setValue(param
     66                print( interface.setValue(param)
    6767                 
    6868else: 
    69         print interface.getValue(
     69        print( interface.getValue()
    7070 
  • trunk/libffado/tests/python/test-echo-routing.py

    r2395 r2680  
    4545                                dbus_interface='org.ffado.Control.Element.Discrete') 
    4646except: 
    47         print "'ffado-dbus-server' should be started in advance." 
     47        print( "'ffado-dbus-server' should be started in advance." ) 
    4848        sys.exit() 
    4949 
     
    5353                raise Exception() 
    5454except: 
    55         print "Your device doesn't support playback-routing." 
     55        print( "Your device doesn't support playback-routing." ) 
    5656        sys.exit() 
    5757 
     
    6767        strm = int(argvs[2]) 
    6868        if ((port > 2) or (strm > 2)): 
    69                 print 'arguments should be less than 3.' 
     69                print( 'arguments should be less than 3.' ) 
    7070                sys.exit() 
    7171        s = router.setValueIdx(port, strm); 
    72         print s 
     72        print( s ) 
    7373# get status 
    7474else: 
    75         print "port\tstream" 
     75        print( "port\tstream" ) 
    7676        for i in range(3): 
    77                 print i, "\t", router.getValueIdx(i); 
     77                print( i, "\t", router.getValueIdx(i); ) 
    7878