コード例 #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)