[Neo-report] r2473 vincent - in /trunk/neo: ./ storage/handlers/ tests/storage/
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Dec 7 10:41:49 CET 2010
Author: vincent
Date: Tue Dec 7 10:41:49 2010
New Revision: 2473
Log:
Move add64 to neo.util module.
Modified:
trunk/neo/storage/handlers/replication.py
trunk/neo/tests/storage/testReplicationHandler.py
trunk/neo/util.py
Modified: trunk/neo/storage/handlers/replication.py
==============================================================================
--- trunk/neo/storage/handlers/replication.py [iso-8859-1] (original)
+++ trunk/neo/storage/handlers/replication.py [iso-8859-1] Tue Dec 7 10:41:49 2010
@@ -20,7 +20,7 @@ import neo
from neo.handler import EventHandler
from neo.protocol import Packets, ZERO_TID, ZERO_OID
-from neo import util
+from neo.util import add64
# TODO: benchmark how different values behave
RANGE_LENGTH = 4000
@@ -78,10 +78,6 @@ def checkConnectionIsReplicatorConnectio
return result
return decorator
-def add64(packed, offset):
- """Add a python number to a 64-bits packed value"""
- return util.p64(util.u64(packed) + offset)
-
class ReplicationHandler(EventHandler):
"""This class handles events for replications."""
Modified: trunk/neo/tests/storage/testReplicationHandler.py
==============================================================================
--- trunk/neo/tests/storage/testReplicationHandler.py [iso-8859-1] (original)
+++ trunk/neo/tests/storage/testReplicationHandler.py [iso-8859-1] Tue Dec 7 10:41:49 2010
@@ -17,9 +17,10 @@
import unittest
from mock import Mock
+from neo.util import add64
from neo.tests import NeoUnitTestBase
from neo.protocol import Packets, ZERO_OID, ZERO_TID
-from neo.storage.handlers.replication import ReplicationHandler, add64
+from neo.storage.handlers.replication import ReplicationHandler
from neo.storage.handlers.replication import RANGE_LENGTH, MIN_RANGE_LENGTH
class FakeDict(object):
Modified: trunk/neo/util.py
==============================================================================
--- trunk/neo/util.py [iso-8859-1] (original)
+++ trunk/neo/util.py [iso-8859-1] Tue Dec 7 10:41:49 2010
@@ -28,6 +28,10 @@ def u64(s):
def p64(n):
return pack('!Q', n)
+def add64(packed, offset):
+ """Add a python number to a 64-bits packed value"""
+ return p64(u64(packed) + offset)
+
def dump(s):
"""Dump a binary string in hex."""
if s is None:
More information about the Neo-report
mailing list