PEATDB/Ekin/Ekin_main.py
def sort_by_Num(self, p):
        """Sort text keys by contained numbers"""
        splitkeys={}
        import re
        r=re.compile('\D')
        for k in p:
            value=None
            for splitval in r.split(k):
                try:
                    value=int(splitval)
                except ValueError:
                    pass
            if not value:
                print 'no number in', k
            splitkeys[k]=value
        items = splitkeys.items()
        items = [(v, k) for (k, v) in items]
        items.sort()
        return items
Sort text keys by contained numbers
Sort text keys by contained numbers
Sort text keys by contained numbers
def sort_by_Num(self, p):
        splitkeys={}
        import re
        r=re.compile('\D')
        for k in p:
            value=None
            for splitval in r.split(k):
                try:
                    value=int(splitval)
                except ValueError:
                    pass
            if not value:
                print 'no number in', k
            splitkeys[k]=value
        items = splitkeys.items()
        items = [(v, k) for (k, v) in items]
        items.sort()
        return items
def sort_by_Num ( self , p ) : splitkeys = { } import re r = re . compile ( '\D' ) for k in p : value = None for splitval in r . split ( k ) : try : value = int ( splitval ) except ValueError : pass if not value : print 'no number in' , k splitkeys [ k ] = value items = splitkeys . items ( ) items = [ ( v , k ) for ( k , v ) in items ] items . sort ( ) return items
Sort text keys by contained numbers
Sort text keys by contained numbers
"""Sort text keys by contained numbers"""
self
p