示例#1
0
	def __cmp__( self, other ):
		if self.protocol != other.protocol:
			return self.protocol.__cmp__( other.protocol )

		if self.user != other.user:
			return self.user.__cmp__( other.user )

		if self.password != other.password:
			return self.password.__cmp__( other.password )

		if self.host != other.host:
			return self.host.__cmp__( other.host )

		if self.port != other.port:
			return self.port.__cmp__( other.port )

		n = Params.__cmp__( self.params, self.kparams, other.params, other.kparams )
		if n != 0:
			return n

		n = HParams.__cmp__( self.hparams, self.hkparams, other.hparams, other.hkparams )
		if n != 0:
			return n

		return 0
示例#2
0
	def __cmp__( self, other ):
		if self.value != other.value:
			return self.value.__cmp__( other.value )

		n = Params.__cmp__( self.params, self.kparams, other.params, other.kparams )
		if n != 0:
			return n

		return 0
示例#3
0
	def __cmp__( self, other ):
		if self.uri != other.uri:
			return self.uri.__cmp__( other.uri )

		n = Params.__cmp__( self.params, self.kparams, other.params, other.kparams )
		if n != 0:
			return n

		return 0
示例#4
0
	def __cmp__( self, other ):
#FIXME: Other __cmp__ must handler other=None
		if not other:
			return 0

		if self.value != other.value:
			return self.value.__cmp__( other.value )

		n = Params.__cmp__( self.params, self.kparams, other.params, other.kparams )
#FIXME: Why this check here and in other cases?
		if n != 0:
			return n

		return 0
示例#5
0
	def __cmp__( self, other ):
		if self.name != other.name:
			return self.name.__cmp__( other.name )

		if self.uri != other.uri:
			return self.uri.__cmp__( other.uri )

#FIXME:DEBUG:		return super( Address, self ).__cmp__( other )

		n = Params.__cmp__( self.params, self.kparams, other.params, other.kparams )
		if n != 0:
			return n

		return 0
示例#6
0
	def __cmp__( self, other ):
		if self.protocol != other.protocol:
			return self.protocol.__cmp__( other.protocol )

		if self.version != other.version:
			return self.version.__cmp__( other.version )

		if self.transport != other.transport:
			return self.transport.__cmp__( other.transport )

		if self.host != other.host:
			return self.host.__cmp__( other.host )

		n = Params.__cmp__( self.params, self.kparams, other.params, other.kparams )
		if n != 0:
			return n

		return 0