Fix local_run with empty localconfig

This commit is contained in:
Laurent Bachelier 2013-03-25 03:15:31 +01:00 committed by Florent
commit 7b53583357
2 changed files with 3 additions and 1 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@ dist
tags
docs/source/api
modules/modules.list
/localconfig

View file

@ -15,7 +15,7 @@ else:
project = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
wd = os.path.join(project, 'localconfig')
if not os.path.isdir(wd):
os.path.makedirs(wd)
os.makedirs(wd)
env = os.environ.copy()
env['PYTHONPATH'] = project
@ -24,6 +24,7 @@ env['WEBOOB_WORKDIR'] = wd
shutil.copyfile(
os.path.expanduser('~/.config/weboob/backends'),
os.path.join(project, wd, 'backends'))
os.chmod(os.path.join(project, wd, 'backends'), 0600)
with open(os.path.join(wd, 'sources.list'), 'w') as f:
f.write("file://%s\n" % os.path.join(project, 'modules'))