~ubuntu-branches/ubuntu/wily/pymongo/wily

« back to all changes in this revision

Viewing changes to pymongo/master_slave_connection.py

  • Committer: Package Import Robot
  • Author(s): Federico Ceratto
  • Date: 2012-05-10 21:21:40 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20120510212140-9c66c00zz850h6l9
Tags: 2.2-1
* New upstream release.
* Dependencies added (Closes: #670268)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2010 10gen, Inc.
 
1
# Copyright 2009-2012 10gen, Inc.
2
2
#
3
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
4
# you may not use this file except in compliance with the License.
192
192
        that all operations performed within a request will be sent
193
193
        using the Master connection.
194
194
        """
 
195
        self.master.start_request()
195
196
        self.__in_request = True
196
197
 
197
198
    def end_request(self):
202
203
        self.__in_request = False
203
204
        self.__master.end_request()
204
205
 
205
 
    def __cmp__(self, other):
 
206
    def __eq__(self, other):
206
207
        if isinstance(other, MasterSlaveConnection):
207
 
            return cmp((self.__master, self.__slaves),
208
 
                       (other.__master, other.__slaves))
 
208
            us = (self.__master, self.slaves)
 
209
            them = (other.__master, other.__slaves)
 
210
            return us == them
209
211
        return NotImplemented
210
212
 
211
213
    def __repr__(self):