예제 #1
0
파일: path.py 프로젝트: briner/libcbr
 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
예제 #2
0
 def cmp_by_name(self, a, b):
     return mix.cmpAlphaNum(a.zonename, b.zonename)
예제 #3
0
파일: zfs.py 프로젝트: briner/libcbr
 def cmp_by_name(cls, a, b):
     return mix.cmpAlphaNum(a.name, b.name)
예제 #4
0
파일: zfs.py 프로젝트: briner/libcbr
 def __cmp__(self, other):
     if isinstance(other, Snapshot):
         return mix.cmpAlphaNum(self.name, other.name)
     else:
         return -1
예제 #5
0
파일: zfs.py 프로젝트: briner/libcbr
 def cmp_by_name(cls, a, b):
     return mix.cmpAlphaNum(a.name, b.name)
예제 #6
0
파일: zfs.py 프로젝트: briner/libcbr
 def __cmp__(self, other):
     if isinstance(other, Snapshot):
         return mix.cmpAlphaNum(self.name, other.name)
     else:
         return -1
예제 #7
0
파일: zone.py 프로젝트: briner/libcbr
 def cmp_by_name(self, a,b):
     return mix.cmpAlphaNum(a.zonename, b.zonename)