Changeset 1190 for SHX


Ignore:
Timestamp:
13.04.2016 20:44:11 (3 years ago)
Author:
klaus
Message:

drag and drop for command files

Location:
SHX/trunk/SeismicHandler/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/modules/parse.py

    r1172 r1190  
    629629        #self.cmdbuf[self.cnt] = (name,cmd) 
    630630        #print "dbg: _message_cmd:", name, cmd 
    631         s = Script( StringIO.StringIO(cmd+'\nreturn\n'), Symbol(), Switches() ) 
     631        sio = StringIO.StringIO(cmd+'\nreturn\n') 
     632        if os.path.exists(name): 
     633            s = Script( sio, Symbol(), Switches(), searchpath=[name] ) 
     634        else: 
     635            s = Script( sio, Symbol(), Switches() ) 
    632636        s.run() 
    633637     
  • SHX/trunk/SeismicHandler/modules/wx_.py

    r1189 r1190  
    33613361        for fname in filenames: 
    33623362            if fname.endswith('.SHC'): 
    3363                 # doesn't work due to path isn't resolved 
    3364                 shcmd = '@' + fname.replace('/','\\') 
     3363                spath = os.path.dirname(fname) 
     3364                cmd = os.path.basename(fname) 
     3365                shcmd = '@' + cmd 
     3366                _sendShCommand( shcmd, searchpath=spath ) 
    33653367            else: 
    33663368                shcmd = "@READO %s" % fname.replace('/','\\') 
    3367             print shcmd 
    3368             _sendShCommand( shcmd ) 
    3369  
    3370          
     3369                _sendShCommand( shcmd ) 
    33713370 
    33723371 
     
    33803379 
    33813380 
    3382 def _sendShCommand( cmdstring, name="default" ): 
     3381def _sendShCommand( cmdstring, searchpath="default" ): 
    33833382    "Send command to command line interpreter." 
    33843383    wx.BeginBusyCursor() 
    33853384    try: 
    3386         msgs.sendMessage("ui.command", cmd=cmdstring, name=name ) 
     3385        msgs.sendMessage("ui.command", cmd=cmdstring, name=searchpath ) 
    33873386        exc = None 
    33883387    except Exception as exc: 
Note: See TracChangeset for help on using the changeset viewer.