Changeset 811 for SHX/trunk


Ignore:
Timestamp:
11/01/12 21:33:46 (8 years ago)
Author:
marcus
Message:
  • support '~' user expanding
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/tools/import_inventory.py

    r810 r811  
    9191 
    9292    data = {} 
     93    if name.startswith('~'): 
     94        name = os.path.expanduser(name) 
    9395    with codecs.open(name, "rb", "ascii") as f: 
    9496        content = f.readlines() 
     
    171173    if fdir.startswith('$'): 
    172174        fdir = os.getenv(fdir[1:]) 
     175    if fdir.startswith('~'): 
     176        fdir = os.path.expanduser(fdir) 
    173177 
    174178    filters = {} 
    175179    assigns = {} 
     180    if name.startswith('~'): 
     181        name = os.path.expanduser(name) 
    176182    with open(name) as f: 
    177183        content = f.readlines() 
     
    240246    """ 
    241247    gains = [] 
     248    if name.startswith('~'): 
     249        name = os.parse_gain.expanduser(name) 
    242250    with open(name) as f: 
    243251        content = f.readlines() 
     
    272280    Merge information together. 
    273281    """ 
    274      
     282 
    275283    # loop through stations 
    276284    for s in stainf: 
Note: See TracChangeset for help on using the changeset viewer.