Changeset 2746

Show
Ignore:
Timestamp:
01/31/18 02:19:30 (4 months ago)
Author:
jwoithe
Message:

[PATCH 10/13] tools: Fix python file indents in a separate commit.

From Nicolas Boulenguez.

Files:

Legend:

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

    r2744 r2746  
    106106    print (" Prerequisites (static at compile-time)...") 
    107107    try: 
    108      with open( "$PYTHONDIR/static_info.txt", "r" ) as f: 
    109       for line in f: 
    110         line = line[:-1] 
    111         if line is not "\n" and line.startswith("  "): 
    112             print (line) 
     108        with open( "$PYTHONDIR/static_info.txt", "r" ) as f: 
     109            for line in f: 
     110                line = line[:-1] 
     111                if line is not "\n" and line.startswith("  "): 
     112                    print (line) 
    113113    except: 
    114114        print ("Failed to read $PYTHONDIR/static_info.txt.") 
  • trunk/libffado/support/tools/ffado-sandbox-install.py

    r2745 r2746  
    299299ffado_scons_options = ("-j2",) # TODO: interactive config of the build 
    300300with open (ffado_log, 'w') as log: 
    301   log.write ('\n') 
    302  
    303   # configure FFADO 
    304   os.chdir("%s/libffado/" % build_dir) 
    305   print( "Building FFADO..." ) 
    306   print( " Compiling..." ) 
    307   if subprocess.call (('scons', 'PREFIX="' + sandbox_dir + '"') + ffado_scons_options, 
    308                       stdout=log): 
    309     print( """ ) 
     301 
     302    # configure FFADO 
     303    os.chdir("%s/libffado/" % build_dir) 
     304    print( "Building FFADO..." ) 
     305    print( " Compiling..." ) 
     306    if subprocess.call (('scons', 'PREFIX="' + sandbox_dir + '"') + ffado_scons_options, 
     307                        stdout=log): 
     308       print( """ ) 
    310309Failed to configure/build FFADO. Most likely this is due to uninstalled dependencies. 
    311310Check %s for details. 
    312311""" % ffado_log 
    313     exit(-1) 
    314  
    315   # install FFADO 
    316   print( " Installing into %s..." % sandbox_dir ) 
    317   if subprocess.check_output (('scons', 'install'), stdout=log): 
    318     print( "Failed to install FFADO. Check %s for details." % ffado_log ) 
    319     exit(-1) 
     312        exit(-1) 
     313 
     314    # install FFADO 
     315    print( " Installing into %s..." % sandbox_dir ) 
     316    if subprocess.check_output (('scons', 'install'), stdout=log): 
     317        print( "Failed to install FFADO. Check %s for details." % ffado_log ) 
     318        exit(-1) 
    320319 
    321320# configure JACK 
     
    323322jack_log = "%s/jackbuild.log" % build_dir 
    324323with open (jack_log, 'w') as log: 
    325   log.write ('\n') 
    326  
    327   print( "Building Jack..." ) 
    328   if use_jack_version[1] == 'svn': 
    329     print( " Initializing build system..." ) 
    330     if subprocess.check_output (('./autogen.sh',), stdout=log): 
    331         print( """ ) 
     324    log.write ('\n') 
     325 
     326    print( "Building Jack..." ) 
     327    if use_jack_version[1] == 'svn': 
     328        print( " Initializing build system..." ) 
     329        if subprocess.check_output (('./autogen.sh',), stdout=log): 
     330            print( """ ) 
    332331Failed to initialize the jack build system. Most likely this is due to uninstalled dependencies. 
    333332Check %s for details. 
    334333""" % jack_log 
    335         exit(-1) 
    336  
    337     print( " Configuring build..." ) 
    338     if subprocess.check_output (('./configure', '--prefix="' + sandbox_dir + '"'), 
    339                                 stdout=log): 
    340         print( """ ) 
     334            exit(-1) 
     335 
     336        print( " Configuring build..." ) 
     337        if subprocess.check_output (('./configure', '--prefix="' + sandbox_dir + '"'), 
     338                                    stdout=log): 
     339            print( """ ) 
    341340Failed to configure the jack build. Most likely this is due to uninstalled dependencies. 
    342341Check %s for details. 
    343342""" % jack_log 
    344         exit(-1) 
    345  
    346     # build and install jack 
    347     print( " Compiling..." ) 
    348     if subprocess.check_output (('make',), stdout=log): 
    349         print( "Failed to build jack. Check %s for details." % jack_log ) 
    350         exit(-1) 
    351  
    352     print( " Installing into %s..." % sandbox_dir ) 
    353     if subprocess.check_output (('make', 'install'), stdout=log): 
    354         print( "Failed to install jack. Check %s for details." % jack_log ) 
    355         exit(-1) 
     343            exit(-1) 
     344 
     345        # build and install jack 
     346        print( " Compiling..." ) 
     347        if subprocess.check_output (('make',), stdout=log): 
     348            print( "Failed to build jack. Check %s for details." % jack_log ) 
     349            exit(-1) 
     350 
     351        print( " Installing into %s..." % sandbox_dir ) 
     352        if subprocess.check_output (('make', 'install'), stdout=log): 
     353            print( "Failed to install jack. Check %s for details." % jack_log ) 
     354            exit(-1) 
    356355 
    357356# write the bashrc file 
     
    372371sandbox_rc_file = "%s/ffado.rc" % sandbox_dir 
    373372try: 
    374   with open (sandbox_rc_file, "w") as fid: 
    375     fid.write(sandbox_bashrc) 
     373    with open (sandbox_rc_file, "w") as fid: 
     374        fid.write(sandbox_bashrc) 
    376375except: 
    377376    print( "Could not write the sandbox rc file." ) 
  • trunk/libffado/support/tools/ffado_diag_helpers.py

    r2743 r2746  
    4747    log.info("Checking if module '%s' is present in %s... " % (modulename, procfile)) 
    4848    with open (procfile) as f: 
    49       for l in f: 
    50         if modulename in l or modulename.replace('-', '_') in l: 
    51             log.info(" found") 
    52             return True 
     49        for l in f: 
     50            if modulename in l or modulename.replace('-', '_') in l: 
     51                log.info(" found") 
     52                return True 
    5353    log.info(" not found") 
    5454    return False 
     
    147147    outtext = run_command ((lspci_cmd,)) 
    148148    for c in outtext.split("\n"): 
    149       if '1394' in c: 
    150         tmp = c.split() 
    151         if len(tmp) > 0: 
    152             cmd = (lspci_cmd, '-vv', '-nn', '-s', tmp[0]) 
    153             print( run_command(cmd) ) 
     149        if '1394' in c: 
     150            tmp = c.split() 
     151            if len(tmp) > 0: 
     152                cmd = (lspci_cmd, '-vv', '-nn', '-s', tmp[0]) 
     153                print( run_command(cmd) ) 
    154154 
    155155def get_juju_permissions():