1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-25 17:42:29 +00:00

Changed data directory

This commit is contained in:
J. Fernando Sánchez 2017-02-28 18:31:43 +01:00
parent d8b59d06a4
commit 97bd245dfc
2 changed files with 5 additions and 4 deletions

View File

@ -6,7 +6,7 @@ RUN mkdir /cache/ /senpy-plugins /data/
VOLUME /data/ VOLUME /data/
ENV PIP_CACHE_DIR=/cache/ ENV PIP_CACHE_DIR=/cache/ SENPY_DATA=/data
ONBUILD COPY . /senpy-plugins/ ONBUILD COPY . /senpy-plugins/
ONBUILD RUN python -m senpy --only-install -f /senpy-plugins ONBUILD RUN python -m senpy --only-install -f /senpy-plugins

View File

@ -3,6 +3,7 @@ standard_library.install_aliases()
import inspect import inspect
import os.path import os.path
import os
import pickle import pickle
import logging import logging
import tempfile import tempfile
@ -92,8 +93,8 @@ class ShelfMixin(object):
@property @property
def shelf_file(self): def shelf_file(self):
if 'shelf_file' not in self or not self['shelf_file']: if 'shelf_file' not in self or not self['shelf_file']:
self.shelf_file = os.path.join(tempfile.gettempdir(), sd = os.environ.get('SENPY_DATA', tempfile.gettempdir())
self.name + '.p') self.shelf_file = os.path.join(sd, self.name + '.p')
return self['shelf_file'] return self['shelf_file']
def save(self): def save(self):