Changeset 531
- Timestamp:
- 02/02/2012 05:51:18 PM (12 years ago)
- Location:
- SHX/trunk/SeismicHandler
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
SHX/trunk/SeismicHandler/basics/error.py
r529 r531 35 35 # log message 36 36 msgs.sendMessage("log.error", message=str(self)) 37 setStatus(getattr(self, "status", "unset")) 37 38 38 39 def __str__(self): … … 46 47 """ 47 48 48 def __init__(self, value ):49 def __init__(self, value, status=1): 49 50 self.value = value 50 se tStatus(1)51 self.status = status 51 52 Error.__init__(self) 52 53 -
SHX/trunk/SeismicHandler/basics/tools.py
r258 r531 9 9 def Property(func): 10 10 return property(**func()) 11 11 12 12 13 class Singleton(type): … … 24 25 25 26 return cls.instance 27 28 29 def expandTraceList(trcs, selection): 30 """ 31 Expand comma separated list of traces into sorted internal trace numbers 32 (reverse order). 33 """ 34 35 if not len(trcs): 36 return None 37 38 selection = [i.lower() for i in selection.split(",")] 39 40 if "all" in selection: 41 selected = range(0, len(trcs)) 42 selected.reverse() 43 return selected 44 45 selected = [] 46 for s in selection: 47 # range 48 if "-" in s: 49 try: 50 start, stop = map(int, s.split("-")) 51 except: 52 print " skipping '%s'" % s 53 continue 54 55 if stop < start: 56 start, stop = stop, start 57 58 selected.extend(range(start - 1, stop)) 59 60 else: 61 if s.isdigit(): 62 selected.append(int(s) - 1) 63 else: 64 print " skipping '%s'" % s 65 66 # unique 67 selected = list(set(selected)) 68 selected.sort() 69 selected.reverse() 70 71 return selected -
SHX/trunk/SeismicHandler/modules/parse.py
r530 r531 509 509 quit() 510 510 511 def commandIf(self, cmd): 511 def commandIf(self, *args, **kwargs): 512 print args, kwargs 512 513 pass 513 514 … … 695 696 except NotImplementedError: 696 697 raise NotImplementedError 698 except ShxError, e: 699 raise ShxError("'%s' could not be translated!" % value, e.status) 697 700 except: 698 raise ShxError("'%s' could not be translated!" % value )701 raise ShxError("'%s' could not be translated!" % value, 1716) 699 702 700 703 def __handleSystem(self, name): -
SHX/trunk/SeismicHandler/patches/ObsPy.py
r529 r531 33 33 from obspy.sh.core import fromUTCDateTime 34 34 from SeismicHandler.basics.messages import logMessage, setStatus 35 from SeismicHandler.basics.error import ShxError 35 36 36 37 __all__ = [] … … 242 243 return self.shx[name] 243 244 244 raise NameError245 raise ShxError("Info entry not found", 1703) 245 246 246 247 # monkey patching obspy stream class: traces are merge automatically if stream
Note: See TracChangeset
for help on using the changeset viewer.