Changeset 1057 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Sep 17, 2013 4:22:51 PM (8 years ago)
Author:
toby
Message:

reorg UserCalibrants? into ImageCalibrants?; Add trim (whitespace) routine; fix InstName? bug in GetHistogramPhaseData?; rework ValidatedTxtCtrl? for CIF; ScrolledMultiEditor? now resets after Cancel; CIF export progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1034 r1057  
    2727import cPickle
    2828import sys
     29import re
    2930import random as ran
    3031import GSASIIpath
     
    5354    else:
    5455        return 0
     56
     57
     58def trim(val):
     59    '''Simplify a string containing leading and trailing spaces
     60    as well as newlines, tabs, repeated spaces etc. into a shorter and
     61    more simple string, by replacing all ranges of whitespace
     62    characters with a single space.
     63
     64    :param str val: the string to be simplified
     65
     66    :returns: the (usually) shortened version of the string
     67    '''
     68    return re.sub('\s+', ' ', val).strip()
    5569
    5670def makeInstDict(names,data,codes):
Note: See TracChangeset for help on using the changeset viewer.