Changeset 26909


Ignore:
Timestamp:
02/28/22 03:18:11 (3 years ago)
Author:
bdef
Message:

CHG: profiling in pairoption

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/pairoptions.py

    r26307 r26909  
    1111
    1212    def __init__(self, *arg):  # {{{
    13         self.functionname = ''
     13        #self.functionname = ''
    1414        self.list = OrderedDict()
    1515
    1616        #get calling function name
    17         import inspect
    18         if len(inspect.stack()) > 1:
    19             self.functionname = inspect.stack()[1][3]
     17        #import inspect
     18        #if len(inspect.stack()) > 1:
     19        #self.functionname = inspect.stack()[1][3]
     20        import traceback
     21        try:
     22            self.functionname = traceback.extract_stack(limit=2)[0][2]
     23        except IndexError:
     24            pass  #this is probably similar to the previous if treatment (but faster)
    2025
    2126        #initialize list
     
    98103        """
    99104
    100         disp(['WARNING: pairoptions::displayunused is not yet implemented'])
     105        print('WARNING: pairoptions::displayunused is not yet implemented')
    101106    # }}}
     107
    102108    def exist(self, field):  # {{{
    103109        """EXIST - check if the option exists
Note: See TracChangeset for help on using the changeset viewer.