Changeset 24726


Ignore:
Timestamp:
04/22/20 20:46:04 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: minor

Location:
issm/trunk-jpl/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/scripts/BinRead.py

    r24225 r24726  
    55import struct
    66from argparse import ArgumentParser
    7 
    87
    98def BinRead(filin, filout='', verbose=0):  #{{{
     
    123122#}}}
    124123
    125 
    126124def FormatToCode(format):  # {{{
    127125    """
     
    154152    return code
    155153# }}}
    156 
    157154
    158155def CodeToFormat(code):  # {{{
     
    187184# }}}
    188185
    189 
    190186if __name__ == '__main__':  #{{{
    191     if 'PYTHONSTARTUP' in environ:
    192         PYTHONSTARTUP = environ['PYTHONSTARTUP']
    193         print('PYTHONSTARTUP = {}'.format(PYTHONSTARTUP))
    194         if path.exists(PYTHONSTARTUP):
    195             try:
    196                 exec(compile(open(PYTHONSTARTUP).read(), PYTHONSTARTUP, 'exec'), globals())
    197 
    198             except Exception as e:
    199                 print("PYTHONSTARTUP error: ", e)
    200         else:
    201             print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))
    202 
    203187    parser = ArgumentParser(description='BinRead - function to read binary input file.')
    204188    parser.add_argument('-f', '--filin', help='name of binary input file', default='')
  • issm/trunk-jpl/scripts/OutbinRead.py

    r24725 r24726  
    128128
    129129if __name__ == '__main__':  #{{{
    130     if 'PYTHONSTARTUP' in environ:
    131         PYTHONSTARTUP = environ['PYTHONSTARTUP']
    132         print('PYTHONSTARTUP = {}'.format(PYTHONSTARTUP))
    133         if path.exists(PYTHONSTARTUP):
    134             try:
    135                 exec(compile(open(PYTHONSTARTUP).read(), PYTHONSTARTUP, 'exec'), globals())
    136 
    137             except Exception as e:
    138                 print("PYTHONSTARTUP error: ", e)
    139         else:
    140             print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))
    141 
    142130    parser = ArgumentParser(description='OutbinRead - function to read binary input file.')
    143131    parser.add_argument('-f', '--filin', help='name of binary input file', default='')
Note: See TracChangeset for help on using the changeset viewer.