def __cmp__(self, other): if(str(self))==(str(other)): return 0 else: lself=str(self).split('/') lother=str(other).split('/') if( ''==lself[0] ): lself.remove('') if( ''==lself[len(lself)-1] ): lself.remove('') if( ''==lother[0] ): lother.remove('') if( ''==lother[len(lother)-1] ): lother.remove('') for i in range( min( len(lself),len(lother) ) ): ret=mix.cmpAlphaNum(lself[i], lother[i]) if 0 != ret: return ret else: if len(lself)>len(lother): #/obs/system /obs return 1 else: return -1
def cmp_by_name(self, a, b): return mix.cmpAlphaNum(a.zonename, b.zonename)
def cmp_by_name(cls, a, b): return mix.cmpAlphaNum(a.name, b.name)
def __cmp__(self, other): if isinstance(other, Snapshot): return mix.cmpAlphaNum(self.name, other.name) else: return -1
def cmp_by_name(self, a,b): return mix.cmpAlphaNum(a.zonename, b.zonename)