1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-09-18 04:22:21 +00:00

New shelf location and better shelf tests

This commit is contained in:
J. Fernando Sánchez
2016-12-19 18:18:47 +01:00
parent 40b67503ce
commit d72a995fa9
11 changed files with 66 additions and 29 deletions

View File

@@ -1 +1 @@
0.6.1
0.6.2

View File

@@ -19,7 +19,8 @@ Sentiment analysis server in Python
"""
import os
VFILE = os.path.join(os.path.dirname(__file__), "VERSION")
with open(VFILE, 'r') as f:
__version__ = f.read().strip()
from .version import __version__
__all__ = ['api', 'blueprints', 'cli', 'extensions', 'models', 'plugins']

View File

@@ -88,8 +88,9 @@ def main():
args.port))
http_server.serve_forever()
except KeyboardInterrupt:
http_server.stop()
print('Bye!')
http_server.stop()
sp.deactivate_all()
if __name__ == '__main__':
main()

View File

@@ -47,4 +47,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -5,6 +5,7 @@ import inspect
import os.path
import pickle
import logging
import tempfile
from .models import Response, PluginModel, Error
logger = logging.getLogger(__name__)
@@ -83,7 +84,7 @@ class ShelfMixin(object):
if hasattr(self, '_info') and 'shelf_file' in self._info:
self.__dict__['_shelf_file'] = self._info['shelf_file']
else:
self._shelf_file = os.path.join(self.get_folder(), self.name + '.p')
self._shelf_file = os.path.join(tempfile.gettempdir(), self.name + '.p')
return self._shelf_file
def save(self):

4
senpy/version.py Normal file
View File

@@ -0,0 +1,4 @@
import os
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as f:
__version__ = f.read().strip()