Changeset a67ec83 in sasview


Ignore:
Timestamp:
May 2, 2017 9:02:06 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
13fe3be
Parents:
c6bdb3b
Message:

lint

Location:
installers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • installers/installer_generator.py

    r2f6d340 ra67ec83  
    66from __future__ import print_function 
    77 
    8 import local_config 
    98import os 
    109import string 
     
    5857            if ext.strip() not in ['.*', ''] and ext.strip() not in list_data: 
    5958                list_data.append((ext, 'string', file_type)) 
    60     except: 
     59    except Exception: 
    6160        pass 
    6261    try: 
     
    6463        if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 
    6564            list_app.append((ext, 'string', file_type)) 
    66     except: 
     65    except Exception: 
    6766        pass 
    6867    try: 
     
    7170            if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 
    7271                list_app.append((ext, 'string', file_type)) 
    73     except: 
     72    except Exception: 
    7473        pass 
    7574    return list_data, list_app 
     
    170169    return msg 
    171170 
    172 def write_language(language=['english'], msfile="compiler:Default.isl"): 
     171def write_languages(languages=('english',), msfile="compiler:Default.isl"): 
    173172    """ 
    174173    define the language of the application 
    175174    """ 
    176175    msg = '' 
    177     if language: 
     176    if languages: 
    178177        msg = "\n\n[Languages]\n" 
    179         for lang in language: 
    180             msg += """Name: "%s";\tMessagesFile: "%s"\n""" % (str(lang), 
    181                                                            str(msfile)) 
     178        for lang in languages: 
     179            msg += """Name: "%s";\tMessagesFile: "%s"\n""" % (str(lang), str(msfile)) 
    182180    return msg 
    183181 
     
    358356    TEMPLATE += write_registry(data_extension=DATA_EXTENSION, 
    359357                                app_extension=APP_EXTENSION) 
    360     TEMPLATE += write_language() 
     358    TEMPLATE += write_languages() 
    361359    TEMPLATE += write_tasks() 
    362360    TEMPLATE += write_file() 
  • installers/setup_mac.py

    red03b99 ra67ec83  
    135135    """ 
    136136    try: 
    137         list = [] 
     137        extensions = [] 
    138138        EXCEPTION_LIST = ['*', '.', ''] 
    139139        from sas.sascalc.dataloader.loader import Loader 
     
    142142            #['All (*.*)|*.*'] 
    143143            file_type, ext = string.split(item, "|*.", 1) 
    144             if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 
    145                 list.append(ext) 
    146     except: 
     144            if ext.strip() not in EXCEPTION_LIST and ext.strip() not in extensions: 
     145                extensions.append(ext) 
     146    except Exception: 
    147147        pass 
    148148    try: 
    149149        file_type, ext = string.split(local_config.APPLICATION_WLIST, "|*.", 1) 
    150         if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 
    151             list.append(ext) 
    152     except: 
     150        if ext.strip() not in EXCEPTION_LIST and ext.strip() not in extensions: 
     151            extensions.append(ext) 
     152    except Exception: 
    153153        pass 
    154154    try: 
    155155        for item in local_config.PLUGINS_WLIST: 
    156156            file_type, ext = string.split(item, "|*.", 1) 
    157             if ext.strip() not in EXCEPTION_LIST and ext.strip() not in list: 
    158                 list.append(ext) 
    159     except: 
     157            if ext.strip() not in EXCEPTION_LIST and ext.strip() not in extensions: 
     158                extensions.append(ext) 
     159    except Exception: 
    160160        pass 
    161161 
    162     return list 
     162    return extensions 
    163163 
    164164EXTENSIONS_LIST = find_extension() 
     
    177177    if os.path.isfile(libxml_path_test): 
    178178        libxml_path = libxml_path_test 
    179 if libxml_path == None: 
     179if libxml_path is None: 
    180180    raise RuntimeError, "Could not find libxml2 on the system" 
    181181 
Note: See TracChangeset for help on using the changeset viewer.