Changeset 884 for SHX/trunk


Ignore:
Timestamp:
11/29/12 11:30:47 (8 years ago)
Author:
marcus
Message:
  • history only activated in interactive mode
Location:
SHX/trunk/SeismicHandler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/__init__.py

    r751 r884  
    1111    # (implicitely loads configuration) 
    1212    import SeismicHandler.modules.log as SHXlog 
    13     import SeismicHandler.modules.history as SHXhistory 
    1413    import SeismicHandler.modules.screen as SHXscreen 
    1514 
  • SHX/trunk/SeismicHandler/bin/start.py

    r759 r884  
    88import sys 
    99from StringIO import StringIO 
    10 try: 
    11     import readline 
    12 except: 
    13     # readline module is not available on Windows OS 
    14     pass 
    1510from SeismicHandler.modules.parse import Script, Symbol, Switches 
    1611from SeismicHandler.basics.error import ShxError 
     
    3227 
    3328def interactive(): 
     29    # activate history for input commands 
     30    import SeismicHandler.modules.history as SHXhistory 
    3431    s = Script(StringIO(""), Symbol(), Switches()) 
    3532    while True: 
  • SHX/trunk/SeismicHandler/modules/history.py

    r880 r884  
    3939 
    4040    def _shutdown(self): 
     41        if not self.history: 
     42            return 
     43 
    4144        if readline: 
    4245            try: 
     
    4750        try: 
    4851            f = open(Settings.config.history.session[0], "w") 
     52            former = None 
    4953            for h in self.history: 
     54                if h[1] == former: 
     55                    continue 
    5056                f.write("%s\n" % h[1]) 
     57                former = h[1] 
    5158            f.close() 
    5259        except Exception, e: 
Note: See TracChangeset for help on using the changeset viewer.