Changeset a618972 in sasview


Ignore:
Timestamp:
Apr 5, 2010 4:36:54 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
4e74e13
Parents:
90d04eb
Message:

check a name of a plottable and remove "_" when necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_loader.py

    r509af3d ra618972  
    11import os, sys,numpy 
    22import wx 
     3import re 
    34from dataFitting import Data1D 
    45from dataFitting import Data2D 
    56from DataLoader.loader import Loader 
    67 
     8def parse_name(name, expression): 
     9    """ 
     10        remove "_" in front of a name 
     11    """ 
     12    if re.match(expression, name) is not None: 
     13        word = re.split(expression, name, 1) 
     14        for item in word:            
     15            if item.lstrip().rstrip() != '': 
     16                return item 
     17    else: 
     18        return name 
     19     
    720def choose_data_file(parent, location=None): 
    821    path = None 
     
    145158            output.filename = str(filename) 
    146159        ## name of the data allow to differentiate data when plotted 
    147         name = output.filename 
     160        name = parse_name(name=output.filename, expression="_") 
    148161        if not name in parent.indice_load_data.keys(): 
    149162            parent.indice_load_data[name] = 0 
     
    200213            new_plot.dxw = dxw 
    201214            
    202             name = str(item.run[0]) 
     215            name = parse_name(name=str(item.run[0]), expression="_") 
    203216            if not name in parent.indice_load_data.keys(): 
    204217                parent.indice_load_data[name] = 0 
Note: See TracChangeset for help on using the changeset viewer.