Revision 7d4da09e lib/utils/algo.py

b/lib/utils/algo.py
26 26
import time
27 27

  
28 28

  
29
_SORTER_RE = re.compile("^%s(.*)$" % (8 * "(\D+|\d+)?"))
29
_SORTER_GROUPS = 8
30
_SORTER_RE = re.compile("^%s(.*)$" % (_SORTER_GROUPS * "(\D+|\d+)?"))
30 31
_SORTER_DIGIT = re.compile("^\d+$")
31 32

  
32 33

  
......
78 79
    return val
79 80

  
80 81

  
81
def _NiceSortKey(value):
82
def NiceSortKey(value):
82 83
  """Extract key for sorting.
83 84

  
84 85
  """
......
107 108

  
108 109
  """
109 110
  if key is None:
110
    keyfunc = _NiceSortKey
111
    keyfunc = NiceSortKey
111 112
  else:
112
    keyfunc = lambda value: _NiceSortKey(key(value))
113
    keyfunc = lambda value: NiceSortKey(key(value))
113 114

  
114 115
  return sorted(values, key=keyfunc)
115 116

  

Also available in: Unified diff