@register.filter(name='truncatechars')
@stringfilter
def truncatechars(value, arg):
    try:
        length = int(arg)
    except ValueError: # Invalid literal for int().
        return value # Fail silently.
    if len(value) > length:
        return value[:length] + '...'
    return value
Test if the MayaVi2 visualization can be deep-copied.
dataset/ETHPy150Open disqus/overseer/overseer/templatetags/overseer_helpers.py/truncatechars--crossover with--dataset/ETHPy150Open enthought/mayavi/mayavi/tests/test_plot3d_mb_reader.py/TestPlot3dMbReader.test_deepcopied