Show
Ignore:
Timestamp:
02/20/09 03:04:09 (4 years ago)
Author:
gpolo
Message:

* Explicitly fail when a path has no change to succeed in
Path.force_set_umit_conf;
* No longer always using force_set_umit_conf in umit_scheduler, that
only happens when explicitly told so.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/umit_scheduler.py

    r4099 r4135  
    6767 
    6868 
    69 def setup_homedir(usethis): 
     69def setup_homedir(usethis, force=False): 
    7070    """ 
    7171    Setting umit home directory. 
    7272    """ 
    73     Path.force_set_umit_conf(usethis) 
     73    if force: 
     74        Path.force_set_umit_conf(usethis) 
     75    else: 
     76        Path.set_umit_conf(usethis) 
    7477 
    7578    global HOME_CONF, RUNNING_FILE 
     
    117120 
    118121    if CONFIG_DIR: # forcing especified dir 
    119         setup_homedir(CONFIG_DIR) 
     122        setup_homedir(CONFIG_DIR, force=True) 
    120123    else: 
    121124        try: 
    122             setup_homedir(sys.argv[2]) 
     125            setup_homedir(sys.argv[2], force=True) 
    123126        except IndexError: # no path especified 
    124             setup_homedir(os.path.join(os.path.expanduser("~"), '.umit')) 
     127            setup_homedir(os.path.expanduser("~")) 
    125128 
    126129    return main(sys.argv[1:]) 
     
    129132if FROZEN_CFG is not None: 
    130133    def write_frozen_cfg(): 
    131         setup_homedir(os.path.join(os.path.expanduser('~'), '.umit')) 
     134        setup_homedir(os.path.expanduser('~')) 
    132135        conf = open(FROZEN_CFG, 'w') 
    133136        conf.write(HOME_CONF)