Changeset 1241


Ignore:
Timestamp:
Mar 4, 2013 11:06:53 AM (9 years ago)
Author:
jemian
Message:

installation tuning at 2ID

Location:
mda2idd_report/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mda2idd_report/src/mda2idd_gui.py

    r1239 r1241  
    477477        # First we create and fill the info object
    478478        info = wx.AboutDialogInfo()
    479         info.Name = sys.argv[0]
    480         info.Version = __version__
    481         info.Description = __doc__
    482         URL = __url__
    483         info.WebSite = (URL, __svnid__)
     479        info.SetName( sys.argv[0] )
     480        info.SetVersion( __version__ )
     481        info.SetDescription( __doc__ )
     482        if float(wx.VERSION_STRING[0:3]) < 2.9: # pre-phoenix wxPython support
     483            info.SetWebSite( __url__ )
     484        else:                                           # phoenix wxPython support
     485            info.SetWebSite( __url__, desc=__svnid__ )
    484486        author = __author__ +  " <" + __author_email__ + ">"
    485         info.Developers = ['main author: ' + author,
    486                            'MDA file support: Tim Mooney <mooney@aps.anl.gov>']
     487        info.SetDevelopers(
     488          (
     489              'main author: ' + __author__ +  " <" + __author_email__ + ">",
     490              'MDA file support: Tim Mooney <mooney@aps.anl.gov>'
     491          )
     492        )
    487493        # Then we call wx.AboutBox giving it the info object
    488494        wx.AboutBox(info)
     
    515521                for k, v in answer.items():
    516522                    msg += '\n* ' + k + ' --> ' + str(v)
    517             except (mda2idd_report.ReadMdaException, mda2idd_report.RankException) as answer:
     523            except (mda2idd_report.ReadMdaException, mda2idd_report.RankException), answer:
    518524                msg = '\n* ' + mdaFile + ': ' + str(answer)
    519525            self.appendSummaryText(msg)
  • mda2idd_report/src/mda2idd_summary.py

    r1240 r1241  
    4141        return ''
    4242   
    43     reportType = {True: mda.skimMDA, False: mda.readMDA}[shortReport]
     43    if 'skimMDA' in mda.__dict__:
     44        reportType = {True: mda.skimMDA, False: mda.readMDA}[shortReport]
     45    else:
     46        reportType = mda.readMDA        # /APSshare/bin/python's mda does not have skimMDA
    4447    try:
    4548        data = reportType(mdaFileName) # just the header info
    46     except Exception as report:
     49    except Exception, report:
    4750        return "problem with %s: %s" % (mdaFileName, str(report))
    4851    if data is None:
    4952        return "could not read: " + mdaFileName
    5053   
     54    headSection = data[0]
    5155    summary = []
    52     summary.append( 'MDA version = %.1f' % data[0]['version'] )
    53     summary.append( 'Filename = %s' % data[0]['filename'] )
    54     summary.append( 'rank = %d' % data[0]['rank'])
    55     summary.append( '1-D Scan # = %d' % data[0]['scan_number'] )
     56    summary.append( 'MDA version = %.1f' % headSection['version'] )
     57    summary.append( 'Filename = %s' % headSection['filename'] )
     58    summary.append( 'rank = %d' % headSection['rank'])
     59    summary.append( '1-D Scan # = %d' % headSection['scan_number'] )
    5660    if len(data) > 1:
    5761        summary.append( '1-D scan timeStamp= %s' % data[1].time )
    58     summary.append( 'dimensions = %s' % str(data[0]['dimensions']))
    59     summary.append( 'acquired_dimensions = %s' % str(data[0]['acquired_dimensions']))
     62    summary.append( 'dimensions = %s' % str(headSection['dimensions']))
     63    if 'acquired_dimensions' in headSection:
     64        summary.append( 'acquired_dimensions = %s' % str(headSection['acquired_dimensions']))
    6065    summary.append('')
    6166   
    6267    # advanced header information obtainable through readMDA() method
    63     if 'ourKeys' in data[0]:
     68    if 'ourKeys' in headSection:
    6469        summary.append( 'EPICS PVs')
    6570        summary.append( '---------')
    6671        summary.append('')
    67         for k in sorted(data[0].keys()):
    68             if k not in data[0]['ourKeys']:
    69                 desc, unit, value, _, _ = data[0][k]
     72        for k in sorted(headSection.keys()):
     73            if k not in headSection['ourKeys']:
     74                desc, unit, value, _, _ = headSection[k]
    7075                txt = ""
    7176                if len(desc) > 0:
Note: See TracChangeset for help on using the changeset viewer.