Changeset 2742

Show
Ignore:
Timestamp:
01/31/18 00:41:31 (4 months ago)
Author:
jwoithe
Message:

[PATCH 06/13] tools: use print in a way compatible with python3.

From Nicolas Boulenguez.

Somehow these print() calls were missed in the earlier patches which dealt
with the issue in other locations throughout the code base.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/tools/ffado-diag.in

    r2741 r2742  
    4747if __name__== '__main__': 
    4848 
    49     print welcome_msg 
     49    print (welcome_msg) 
    5050 
    5151    parse_command_line () 
    5252 
    53     print "=== CHECK ===" 
    54     print " Base system..." 
     53    print ("=== CHECK ===") 
     54    print (" Base system...") 
    5555 
    5656    # check kernel 
    5757    kernel_version = get_kernel_version() 
    58     print "  kernel version............ " + str(kernel_version
     58    print ("  kernel version............ " + str(kernel_version)
    5959    kernel_is_preempt = get_kernel_preempt() 
    60     print "    Preempt (low latency)... " + str(kernel_is_preempt
     60    print ("    Preempt (low latency)... " + str(kernel_is_preempt)
    6161    # Hint: The main parts of the rt patches are in mainline-kernels nowadays. Performance with stock kernels is sufficient... 
    6262    kernel_is_rt_patched = get_kernel_rt_patched() 
    63     print "    RT patched.............. " + str(kernel_is_rt_patched
     63    print ("    RT patched.............. " + str(kernel_is_rt_patched)
    6464 
    6565    # check modules 
     
    7373    newstack_statically_linked = not check_1394newstack_loaded() and check_1394newstack_linked() 
    7474 
    75     print "  old 1394 stack present.... " + str(oldstack_present
    76     print "  old 1394 stack loaded..... " + str(oldstack_loaded
    77     print "  old 1394 stack active..... " + str(oldstack_active
    78     print "  new 1394 stack present.... " + str(newstack_present
    79     print "  new 1394 stack loaded..... " + str(newstack_loaded
    80     print "  new 1394 stack active..... " + str(newstack_active
     75    print ("  old 1394 stack present.... " + str(oldstack_present)
     76    print ("  old 1394 stack loaded..... " + str(oldstack_loaded)
     77    print ("  old 1394 stack active..... " + str(oldstack_active)
     78    print ("  new 1394 stack present.... " + str(newstack_present)
     79    print ("  new 1394 stack loaded..... " + str(newstack_loaded)
     80    print ("  new 1394 stack active..... " + str(newstack_active)
    8181 
    8282    # check /dev/raw1394 node presence 
    8383    devnode_present = check_1394oldstack_devnode_present() 
    84     print "  /dev/raw1394 node present. " + str(devnode_present
     84    print ("  /dev/raw1394 node present. " + str(devnode_present)
    8585    if devnode_present: 
    8686        # check /dev/raw1394 access permissions 
    8787        devnode_permissions = check_1394oldstack_devnode_permissions() 
    88         print "  /dev/raw1394 permissions.. " + str(devnode_permissions
     88        print ("  /dev/raw1394 permissions.. " + str(devnode_permissions)
    8989    else: 
    9090        devnode_permissions = None 
     
    9393        # check permissions 
    9494        newstack_permissions = get_juju_permissions() 
    95         print "  /dev/fw* permissions:" 
    96         print newstack_permissions 
     95        print ("  /dev/fw* permissions:") 
     96        print (newstack_permissions) 
    9797 
    98     print "  User IDs:" 
    99     print get_user_ids(
     98    print ("  User IDs:") 
     99    print (get_user_ids()
    100100 
    101101 
     
    104104    check_libraries () 
    105105 
    106     print " Prerequisites (static at compile-time)..." 
     106    print (" Prerequisites (static at compile-time)...") 
    107107    f = open( "$PYTHONDIR/static_info.txt", "r" ) 
    108108    for line in f: 
    109109        line = line[:-1] 
    110110        if line is not "\n" and line.startswith("  "): 
    111             print line 
     111            print (line) 
    112112    f.close() 
    113113 
    114114    # libraw 
    115115 
    116     print " uname -a..." 
    117     print "   " + run_command("uname -a"
     116    print (" uname -a...") 
     117    print ("   " + run_command("uname -a")
    118118 
    119     print " Hardware..." 
     119    print (" Hardware...") 
    120120    # check host controller 
    121     print "   Host controllers:" 
     121    print ("   Host controllers:") 
    122122    list_host_controllers() 
    123     print "   CPU info:" 
     123    print ("   CPU info:") 
    124124    if len(run_command("which lscpu")) > 0: 
    125         print run_command("lscpu"
     125        print (run_command("lscpu")
    126126    else: 
    127         print run_command("cat /proc/cpuinfo"
     127        print (run_command("cat /proc/cpuinfo")
    128128 
    129     print " Configuration..." 
     129    print (" Configuration...") 
    130130    # check RT settings 
    131131 
    132132    # check IRQ settings 
    133     print "  IRQ information" 
     133    print ("  IRQ information") 
    134134    info = listirqinfo.IRQInfo() 
    135135    info.load() 
    136136    info.display() 
    137137 
    138     print "" 
    139     print "=== REPORT ===" 
     138    print ("") 
     139    print ("=== REPORT ===") 
    140140 
    141141    # do the interpretation of the tests 
    142     print "FireWire kernel drivers:" 
     142    print ("FireWire kernel drivers:") 
    143143    if (oldstack_loaded or oldstack_statically_linked) and \ 
    144144       (newstack_loaded or newstack_statically_linked): 
     
    149149        sys.exit(-1) 
    150150    elif oldstack_statically_linked: 
    151         print "[PASS] Kernel drivers statically linked into the kernel." 
     151        print ("[PASS] Kernel drivers statically linked into the kernel.") 
    152152    elif not oldstack_present: 
    153153        print (helpstrings.MODULES_OLD_STACK_NOT_INSTALLED) 
     
    157157        sys.exit(-1) 
    158158    else: 
    159         print "[PASS] Kernel modules present and correctly loaded." 
     159        print ("[PASS] Kernel modules present and correctly loaded.") 
    160160 
    161161    if not devnode_present: 
     
    167167            sys.exit(-1) 
    168168        else: 
    169             print "[PASS] /dev/raw1394 node present and accessible." 
     169            print ("[PASS] /dev/raw1394 node present and accessible.")