def pair_as_kwarg_string(key, val): if isinstance(val, basestring): return "%s='%s'" % (key, _sugar.trim_str(unicode(val))) return "%s=%s" % (key, val)
def __str__(self): if self.name: return _sugar.trim_str(self.name, maxlen=40) return self.__class__.__name__