Fix typo && var names

This commit is contained in:
Oleksii Shevchuk 2018-08-17 09:44:18 +03:00
parent 1e2bedb6e4
commit 8a7036310f
2 changed files with 12 additions and 12 deletions

View File

@ -30,7 +30,7 @@ script:
after_success: after_success:
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi` - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi`
- | - |
if [ "$TRAVIS_REPO_SLUG" == "alxchk/pupy" ] && [ -z "$TRAVIS_PULL_REQUEST_SLUG" ]; then if [ "$TRAVIS_REPO_SLUG" = "alxchk/pupy" ] && [ -z "$TRAVIS_PULL_REQUEST_SLUG" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS && docker login -u $DOCKER_USER -p $DOCKER_PASS &&
cd $TRAVIS_BUILD_DIR/pupy && cd $TRAVIS_BUILD_DIR/pupy &&
docker push alxchk/pupy:$TAG >/dev/null; docker push alxchk/pupy:$TAG >/dev/null;

View File

@ -7,7 +7,7 @@ import time
import traceback import traceback
from rpyc.core import Connection, consts, brine from rpyc.core import Connection, consts, brine
from threading import Thread, Event, Lock, RLock, current_thread from threading import Thread, Lock, current_thread
from Queue import Queue, Full, Empty from Queue import Queue, Full, Empty
from network.lib import getLogger from network.lib import getLogger
@ -30,24 +30,24 @@ def stream_dump(obj):
@brine.register(brine._dump_registry, str) @brine.register(brine._dump_registry, str)
def _dump_str_to_buffer(obj, stream): def _dump_str_to_buffer(obj, stream):
l = len(obj) obj_len = len(obj)
if l == 0: if obj_len == 0:
stream.append(brine.TAG_EMPTY_STR) stream.append(brine.TAG_EMPTY_STR)
return return
elif l < 5: elif obj_len < 5:
if l == 1: if obj_len == 1:
stream.append(brine.TAG_STR1) stream.append(brine.TAG_STR1)
elif l == 2: elif obj_len == 2:
stream.append(brine.TAG_STR2) stream.append(brine.TAG_STR2)
elif l == 3: elif obj_len == 3:
stream.append(brine.TAG_STR3) stream.append(brine.TAG_STR3)
elif l == 4: elif obj_len == 4:
stream.append(brine.TAG_STR4) stream.append(brine.TAG_STR4)
else: else:
if l < 256: if obj_len < 256:
stream.append(brine.TAG_STR_L1 + brine.I1.pack(l)) stream.append(brine.TAG_STR_L1 + brine.I1.pack(obj_len))
else: else:
stream.append(brine.TAG_STR_L4 + brine.I4.pack(l)) stream.append(brine.TAG_STR_L4 + brine.I4.pack(obj_len))
stream.append(obj) stream.append(obj)