def abbrtask(S, max):
 if (S is None):
  return u'???'
 if (len(S) > max):
  (module, _, cls) = S.rpartition(u'.')
  module = abbr(module, ((max - len(cls)) - 3), False)
  return ((module + u'[.]') + cls)
 return S

def abbrtask ( S , max ) : if ( S is None ) : return u'???' if ( len ( S ) > max ) : ( module , _ , cls ) = S . rpartition ( u'.' ) module = abbr ( module , ( ( max - len ( cls ) ) - 3 ) , False ) return ( ( module + u'[.]' ) + cls ) return S
abbreviate task name .