Python Kivy属性不可调用错误

Python Kivy属性不可调用错误,python,user-interface,properties,kivy,typeerror,Python,User Interface,Properties,Kivy,Typeerror,我试图在Kivy中实现一个图表工具,但当我尝试实例化FlowChartNode类的实例时,我看到了以下错误: Traceback (most recent call last): File "FlowChartExample.py", line 193, in <module> FlowChartExampleApp().run() File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 798, in

我试图在Kivy中实现一个图表工具,但当我尝试实例化FlowChartNode类的实例时,我看到了以下错误:

Traceback (most recent call last):
   File "FlowChartExample.py", line 193, in <module>
     FlowChartExampleApp().run()
   File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 798, in run
     root = self.build()
   File "FlowChartExample.py", line 189, in build
     root = FlowChartExampleWidget()
   File "FlowChartExample.py", line 184, in __init__
     begin_node = FlowChartNode()
   File "FlowChartExample.py", line 116, in __init__
     super(FlowChartNode, self).__init__(**kwargs)
   File "/usr/lib/python2.7/dist-packages/kivy/uix/behaviors.py", line 105, in __init__
     super(ButtonBehavior, self).__init__(**kwargs)
   File "/usr/lib/python2.7/dist-packages/kivy/uix/label.py", line 187, in __init__
     super(Label, self).__init__(**kwargs)
   File "/usr/lib/python2.7/dist-packages/kivy/uix/widget.py", line 261, in __init__
     super(Widget, self).__init__(**kwargs)
   File "_event.pyx", line 252, in kivy._event.EventDispatcher.__init__ (kivy/_event.c:4505)
   File "_event.pyx", line 777, in kivy._event.EventDispatcher.properties (kivy/_event.c:7967)
 TypeError: 'ObservableList' object is not callable
class FlowChartNode(Button):

    #Exposes the event on_properties to allow for binding to expose
    #properties panel in app on triple-press
    properties = ListProperty([0, 0])

    #Properties to set the backgrounds of the node
    background_draggable = StringProperty('img/drag_node_small.png')
    background_pressable = StringProperty('img/press_node_small.png')
    background_dragged = StringProperty('img/drag_node_down_small.png')
    background_pressed = StringProperty('img/press_node_down_small.png')

    #The components of the node
    front = ObjectProperty(None)
    back = ListProperty([])
    connect = ListProperty([])

    #The sparse grid being added to
    sparse_grid = ObjectProperty(None)

    #The assigned cell in the sparse grid
    cell = ObjectProperty(None)

    #Boolean state for draggable or pressable
    is_draggable = BooleanProperty(False)

    def __init__(self, **kwargs):
        super(FlowChartNode, self).__init__(**kwargs)
        if self.is_draggable:
            self.background_normal = self.background_draggable
        else:
            self.background_normal = self.background_pressable
        self.bind(pos=self.set_front)

    def on_touch_down(self, touch):
        if touch.is_triple_tap:
            self.properties = touch.pos
        elif touch.is_double_tap:
            if self.is_draggable:
                self.is_draggable=False
                self.background_normal = self.background_pressable
            else:
                self.is_draggable=True
                self.background_normal = self.background_draggable
        else:
            if self.is_draggable:
                self.background_normal = self.background_pressed
                touch.grab(self)
            else:
                self.background_normal = self.background_dragged
                #Add the connected node
                back_node = FlowChartNode(is_draggable=True)
                connector = FlowConnector()
                back_node.bind(pos=self.set_back)
                self.back.append(back_node)
                self.connect.append(connector)
                self.connect[len(connect) - 1].front = self.front.center
                self.cell.add_widget(connector)
                self.cell.add_widget(back_node)

        return super(FlowChartNode, self).on_touch_down(touch, *args)

    def on_touch_move(self, touch):
        if touch.grab_current == self:
            if self.collide_point(touch.pos):
                for cel in self.sparse_grid.cells:
                    if cel.collide_point(touch.pos):
                        #Snap the grabbed node to the cell
                        self.cell.clear_widgets()
                        self.cell = cel
                        cel.add_widget(self)
        return super(FlowChartNode, self).on_touch_move(touch, *args)

    def on_touch_up(self, touch):
        return super(FlowChartNode, self).on_touch_up(touch, *args)
        if self.is_draggable:
            self.background_normal = self.background_draggable
        else:
            self.background_normal = self.background_pressable

    def set_front(self, *args):
        for con in self.connect:
            con.front = self.center_node.center

    def set_back(self, *args):
        i=0
        for con in self.connect:
            con.back = self.options[i].center
            i+=1
大部分代码来自一个可以找到的工作小部件,以及其他成功的测试和工作小部件。我已经检查了所有与我互动的Kivy属性,它们似乎都得到了正确的处理。我做错了什么

提前感谢您的帮助


Alex

我最终重新编写了一些不同的类,如果您感兴趣,可以找到完整的代码