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:
@@ -1 +1 @@
|
||||
0.6.1
|
||||
0.6.2
|
||||
|
@@ -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']
|
||||
|
@@ -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()
|
||||
|
@@ -47,4 +47,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
@@ -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
4
senpy/version.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import os
|
||||
|
||||
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as f:
|
||||
__version__ = f.read().strip()
|
Reference in New Issue
Block a user