Changeset 339 for SH_SHM/trunk


Ignore:
Timestamp:
03/03/2011 05:03:24 PM (12 years ago)
Author:
marcus
Message:

r178 | walther | 2011-03-03 16:51:56 +0100 (Do, 03 Mär 2011) | 1 line

Backup and replacement of existing station configuration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/setup/setup.py

    r338 r339  
     1import os.path 
    12#! /usr/bin/env python 
    23 
     
    8788 
    8889    install(target) 
     90    customize(target) 
     91 
     92def customize(target): 
     93    """ 
     94    Offers usage of new configuration files. 
     95 
     96    Save user defined configuration files, if choosen. 
     97    """ 
     98 
     99    flist = ["STATINF.DAT", "sensitivities.txt", "filter_lookup.txt"] 
     100 
     101    print "A backup of your shm-config.txt has been saved under" 
     102    print " %s/sh/inputs/shm-config.txt.yours" % target 
     103 
     104    print "Seismic Handler comes with updated station configuration files." 
     105    a = raw_input("Do you want to use them (backup will be saved) [Yn]? ") 
     106 
     107    if a == "n": 
     108        print "Please check the following files manually (sh/inputs):" 
     109        for f in flist: 
     110            print f, "vs.", f+".dist" 
     111        return 
     112 
     113    for f in flist: 
     114        tname = os.pathjoin(target, f) 
     115        if os.path.exists(tname): 
     116            print "Backing up %s... (to %s)" % (f, f+".yours") 
     117            os.system("cp %s %s" % (tname, tname+".yours")) 
     118        os.system("cp %s %s" % (tname+".dist", tname)) 
    89119 
    90120def install(target): 
Note: See TracChangeset for help on using the changeset viewer.