Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 def cmp_by_name(self, a, b):
     return mix.cmpAlphaNum(a.zonename, b.zonename)
Ejemplo n.º 3
0
Archivo: zfs.py Proyecto: briner/libcbr
 def cmp_by_name(cls, a, b):
     return mix.cmpAlphaNum(a.name, b.name)
Ejemplo n.º 4
0
Archivo: zfs.py Proyecto: briner/libcbr
 def __cmp__(self, other):
     if isinstance(other, Snapshot):
         return mix.cmpAlphaNum(self.name, other.name)
     else:
         return -1
Ejemplo n.º 5
0
Archivo: zfs.py Proyecto: briner/libcbr
 def cmp_by_name(cls, a, b):
     return mix.cmpAlphaNum(a.name, b.name)
Ejemplo n.º 6
0
Archivo: zfs.py Proyecto: briner/libcbr
 def __cmp__(self, other):
     if isinstance(other, Snapshot):
         return mix.cmpAlphaNum(self.name, other.name)
     else:
         return -1
Ejemplo n.º 7
0
 def cmp_by_name(self, a,b):
     return mix.cmpAlphaNum(a.zonename, b.zonename)