Changeset 258


Ignore:
Timestamp:
08/10/2010 03:54:28 PM (13 years ago)
Author:
marcus
Message:

Working on miniseed access and configuration file.

Location:
SHX/trunk/src/SeismicHandler
Files:
2 added
6 edited

Legend:

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

    r255 r258  
     1# -*- coding: utf-8 -*- 
     2 
     3from SeismicHandler.basics.tools import * 
     4from obspy.core.util import AttribDict 
  • SHX/trunk/src/SeismicHandler/basics/tools.py

    r257 r258  
    44Collection of globally used helper functions. 
    55""" 
     6__all__ = ["Property", "Singleton"] 
     7 
    68# property wrapper 
    79def Property(func): 
  • SHX/trunk/src/SeismicHandler/modules/history.py

    r257 r258  
    2222"""history function for SHX""" 
    2323 
    24 from SeismicHandler.basics.tools import Singleton 
     24from SeismicHandler.basics import Singleton 
    2525from time import time 
    2626 
  • SHX/trunk/src/SeismicHandler/modules/log.py

    r257 r258  
    2222"""global logging instance for SHX""" 
    2323 
    24 from SeismicHandler.basics.tools import Singleton 
     24from SeismicHandler.basics import Singleton 
    2525import logging 
    2626import os 
  • SHX/trunk/src/SeismicHandler/modules/runtime.py

    r257 r258  
    2121E.g. Echo Channel, Cap Conversion, ... 
    2222""" 
     23import os.path 
    2324 
    2425import sys 
    25 from SeismicHandler.basics.tools import Property, Singleton 
    26 from obspy.core.util import AttribDict 
     26import os 
     27from SeismicHandler.basics import Property, Singleton, AttribDict 
    2728 
    2829class runtime(object): 
     
    7778 
    7879    def __init__(self): 
    79 #        print __file__ 
    80         pass 
     80        self.readConfig() 
     81 
     82    def readConfig(self): 
     83        """ 
     84        Read configuration file. 
     85 
     86        Possible locations of shx.conf 
     87        1. installation directory 
     88        2. /etc/ 
     89        3. $HOME/.shx/ 
     90        """ 
     91 
     92        dirs = [ 
     93            "/etc", 
     94            # some weird fall-back if $HOME does not exists 
     95            os.getenv("HOME", "/etc"), 
     96            os.path.join(os.path.split(__file__)[0], ".."), 
     97        ] 
     98 
     99        for d in dirs: 
     100            if not os.path.exists(os.path.join(d, "shx.conf")): 
     101                continue 
     102 
     103            print "found in", d 
     104 
    81105 
    82106    def __getattr__(self, name): 
  • SHX/trunk/src/SeismicHandler/modules/traces.py

    r257 r258  
    2121 
    2222import sys 
    23 from SeismicHandler.basics.tools import Singleton 
     23from SeismicHandler.basics import Singleton 
    2424from obspy.core.stream import Stream 
    2525 
Note: See TracChangeset for help on using the changeset viewer.