be (slightly) more private

This commit is contained in:
Mike Dirolf 2009-01-22 17:13:32 -05:00
parent 07f65cc1d1
commit e63f818bfe
3 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ class Collection(object):
message = _ZERO
message += bson._make_c_string(self.full_name())
message += data
return self.__database.connection().send_message(operation, message)
return self.__database.connection()._send_message(operation, message)
def database(self):
return self.__database

View File

@ -83,7 +83,7 @@ class Connection(object):
(self.__host, self.__port,
traceback.format_exc()))
def send_message(self, operation, data):
def _send_message(self, operation, data):
"""Say something to Mongo.
Raises ConnectionFailure if the message cannot be sent. Returns the
@ -111,7 +111,7 @@ class Connection(object):
return self.__id - 1
def receive_message(self, operation, request_id):
def _receive_message(self, operation, request_id):
"""Receive a message from Mongo.
Returns the message body. Asserts that the message uses the given opcode
@ -195,7 +195,7 @@ class Connection(object):
message += struct.pack("<i", len(cursor_ids))
for cursor_id in cursor_ids:
message += struct.pack("<q", cursor_id)
self.send_message(2007, message)
self._send_message(2007, message)
def __database_info(self):
"""Get a dictionary of (database_name: size_on_disk).

View File

@ -223,7 +223,7 @@ class Cursor(object):
def send_message(operation, message):
# TODO the send and receive here should be synchronized...
request_id = self.__collection._send_message(operation, message)
response = self.__collection.database().connection().receive_message(1, request_id)
response = self.__collection.database().connection()._receive_message(1, request_id)
response_flag = struct.unpack("<i", response[:4])[0]
if response_flag == 1: