All pastes #356537 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-15 03:29 UTC
rendered paste body
class ListEntry (LabelEntry):
    """A widget for entering a space-separated list of text items"""
    def __init__(self, master=None, label="List", default=''):
        LabelEntry.__init__(self, master, label, default)

    def get(self):
        """Split text into a list at space boundaries."""
#        text = LabelEntry.get(self)
        text = shlex.split(LabelEntry.get(self))
        return text

    def set(self, listvalue):
        """Set a value to a list, joined with spaces."""
        text = ' '.join(listvalue)
        LabelEntry.set(self, text)