Changeset 184


Ignore:
Timestamp:
01/15/2010 01:37:11 PM (13 years ago)
Author:
marcus
Message:
  • fixed startup directory matching
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/src/SeismicHandler/startup.py

    r153 r184  
    55# This file is part of Seismic Handler eXtended (SHX) 
    66# Full details can be found at project website http://www.seismic-handler.org/ 
    7 #  
     7# 
    88# SHX is free software; you can redistribute it and/or modify 
    99# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by 
     
    2323 
    2424import os 
     25import inspect 
    2526 
    2627# first check if pythonpath already covers installation directory 
     
    2829try: 
    2930    import SeismicHandler 
     31    mypath = os.sep.join(os.path.split(inspect.getabsfile(SeismicHandler))[0].split(os.sep)[:-1]) 
    3032    del SeismicHandler 
    3133except ImportError: 
    3234    import sys 
    33     sys.path.append(os.sep.join(os.path.split(__file__)[0].split(os.sep)[:-1])) 
     35    mypath = os.sep.join(os.path.split(os.path.abspath(__file__))[0].split(os.sep)[:-1]) 
     36    sys.path.append(mypath) 
    3437 
    3538# finally import modules and commands for instant usage 
     
    5356        logging.info("start-up parameter found") 
    5457        from SeismicHandler.config.options import options 
    55          
     58 
    5659        try: 
    5760            Run(options.args[0]) 
    58             # After running script from command line, update trace information.  
     61            # After running script from command line, update trace information. 
    5962            MessageService.trigger(Message(MessageService.TRACEUPDATE)) 
    6063        except IndexError: 
    6164            pass 
    62      
     65 
    6366        if not options["keepcmdline"]: 
    6467            Quit() 
    65      
     68 
    6669        del options 
    6770except KeyError: 
Note: See TracChangeset for help on using the changeset viewer.