Skip to content

Commit

Permalink
cachedir
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Feb 6, 2017
1 parent b93425b commit f856bbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def execfile(script, dirname=None):
from .core import ModelParameter, LarchError
from . import array
from . import roles
from .util.dirs import cache as cachedir
core._set_array_module(array)
try:
from .built import build, versions, build_config, longversion
Expand Down
6 changes: 3 additions & 3 deletions py/util/dirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ def __init__(self, basedir):
def __getattr__(self,key):
newdir = os.path.join(self._basedir, key)
return dir_maker(newdir)
def __call__(self, filename=''):
newfile = os.path.join(self._basedir, filename)
def __call__(self, filename='', *arg):
newfile = os.path.join(self._basedir, filename, *arg)
try:
os.makedirs(self._basedir)
os.makedirs(os.path.dirname(newfile))
except FileExistsError:
pass
return newfile
Expand Down

0 comments on commit f856bbe

Please sign in to comment.