Changeset 232


Ignore:
Timestamp:
07/20/2010 05:45:09 PM (12 years ago)
Author:
marcus
Message:
  • command sdel done (solved #23)
Location:
SHX/trunk/src/SeismicHandler
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/src/SeismicHandler/core/parser.py

    r231 r232  
    423423    ... 
    424424    Exception: Symbol BAR not found! 
     425 
     426    If one wants to delete a global symbol but keep the local symbol: 
     427    >>> s.setGlobal("bar", "global") 
     428    >>> s.bar 
     429    'global' 
     430    >>> s.bar = "local" 
     431    >>> s.deleteGlobal("bar") 
     432    >>> s.bar 
     433    'local' 
    425434    """ 
    426435 
     
    472481        self.__dict__["__globals"][name] = value 
    473482 
     483    def deleteGlobal(self, name): 
     484        name = name.upper() 
     485 
     486        del self.__dict__["__globals"][name] 
     487 
    474488if __name__ == "__main__": 
    475489    import doctest 
  • SHX/trunk/src/SeismicHandler/tests/data/SCRIPT1.SHC

    r231 r232  
     1! 
     2! This file contains commands that are only used from Seismic Handler 
     3! scripts. They are tested against the parser. No error should occur. 
     4! 
     5 
    16switch echo on 
    2 !switch capconv off 
     7switch echo off 
     8switch capconv off 
    39sdef foo 3 
     10switch capconv on 
    411sdel foo 
    512echo test /NO_LF 
Note: See TracChangeset for help on using the changeset viewer.