

def _create_link(self):
    ' Create a ComponentLink form the state of the GUI\n\n        Returns\n        -------\n        A new component link\n        '
    expression = str(self.ui.expression.toPlainText())
    pattern = '[^\\s]*:[^\\s]*'

    def add_curly(m):
        return (('{' + m.group(0)) + '}')
    expression = re.sub(pattern, add_curly, expression)
    pc = parse.ParsedCommand(expression, expression._labels)
    label = (str(self.ui.new_label.text()) or 'new component')
    new_id = core.data.ComponentID(label)
    link = parse.ParsedComponentLink(new_id, pc)
    return link

dataset/ETHPy150Open glue-viz/glue/glue/dialogs/custom_component/qt/widget.py CustomComponentWidget._create_link/VarMisuse@78/140 `self`->`expression`