示例#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)