diff --git a/ctl b/ctl index fd00a02..3cd0f6c 100755 --- a/ctl +++ b/ctl @@ -58,7 +58,7 @@ else fi if [ $SYSTEM == "Darwin" ]; then PLATFORM="darwin64" - PLATFORM_PYTHON=3.7 + PLATFORM_PYTHON=3.5 fi export PLATFORM_ENV="$BASE/platform_${PLATFORM}" fi diff --git a/oml/library.py b/oml/library.py index 5590944..3fdf8dc 100644 --- a/oml/library.py +++ b/oml/library.py @@ -217,7 +217,7 @@ class Peer(object): getpreview = [] t0 = time.time() if remove: - logger.debug('remove %s items from %s', len(remove), self.id) + logger.debug('remove %s items', len(remove)) q = item.models.user_items.delete().where(c_user_id.is_(self.id)).where(c_item_id.in_(remove)) state.db.session.execute(q) q = user.models.list_items.delete().where(l_list_id.in_(lists)).where(l_item_id.in_(remove)) @@ -231,7 +231,7 @@ class Peer(object): listitems[row['list_id']].add(row['item_id']) t0 = maybe_commit(t0) if add: - logger.debug('add %s items from %s', len(add), self.id) + logger.debug('add %s items', len(add)) t0 = time.time() q = item.models.user_items.select().where(c_user_id.is_(self.id)) useritems = {r['item_id'] for r in state.db.session.execute(q)} diff --git a/oml/localnodes.py b/oml/localnodes.py index f1a890f..ae9cbb0 100644 --- a/oml/localnodes.py +++ b/oml/localnodes.py @@ -155,4 +155,4 @@ class LocalNodes(dict): def get(self, user_id): if user_id in self and can_connect(self[user_id]): - return self.get(user_id) + return self[user_id] diff --git a/oml/utils.py b/oml/utils.py index 99433ba..50e2e9e 100644 --- a/oml/utils.py +++ b/oml/utils.py @@ -4,7 +4,7 @@ from datetime import datetime from io import StringIO, BytesIO -from PIL import Image, ImageFile +from PIL import Image import base64 import hashlib import json @@ -34,7 +34,6 @@ import logging logging.getLogger('PIL').setLevel(logging.ERROR) logger = logging.getLogger(__name__) -ImageFile.LOAD_TRUNCATED_IMAGES = True ENCODING = 'base64' def valid_olid(id): @@ -70,8 +69,7 @@ def resize_image(data, width=None, size=None): data = StringIO(data) source = Image.open(data) #if source.mode not in ('1', 'CMYK', 'L', 'RGB', 'RGBA', 'RGBX', 'YCbCr'): - if source.mode != 'RGB': - source = source.convert('RGB') + source = source.convert('RGB') source_width = source.size[0] source_height = source.size[1] if size: