Skip to content

Commit

Permalink
Properly manage import directories for editable and non-editable inst…
Browse files Browse the repository at this point in the history
…alls.
  • Loading branch information
ketch committed Nov 2, 2023
1 parent b740c5c commit 694727a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/pyclaw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@
import os
import logging, logging.config


CLAW_dir = os.environ.get('CLAW')
if CLAW_dir == None:
raise Exception('You must set the CLAW environment to use an editable install.')
# To get pyclaw.examples
_path = os.path.dirname(os.path.join(CLAW_dir, 'clawpack'))
if os.path.isdir(_path):
__path__.append(_path)
del _path
_init = os.path.abspath(__file__)
_root = os.path.dirname(os.path.dirname(os.path.dirname(_init)))
if os.path.isdir(_root):
__path__.append(_root)

# Default logging configuration file
_DEFAULT_LOG_CONFIG_PATH = os.path.join(os.path.dirname(__file__),'log.config')
del os
del os, _init, _root

# Setup loggers
logging.config.fileConfig(_DEFAULT_LOG_CONFIG_PATH, disable_existing_loggers=False)
Expand Down

0 comments on commit 694727a

Please sign in to comment.