分析kivy中的运行时错误

时间:2015-04-02 13:09:04

标签: python debugging python-3.x kivy

我刚刚开始我的第一个kivy项目。我想知道如何调试这种东西。即使我深入调试了kivy代码,我也不知道哪种属性错误或缺失。因此,我不仅要求解决这个问题,还要求有效分析问题的想法。 这是python和kivy-lang代码以及运行时日志记录。

的Python:

from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.app import App

class MainLayout(BoxLayout):
    pass

class MenuLayout(GridLayout):
    pass

class HomeToucherApp(App):
    def build(self):
        return MainLayout()

if __name__ == "__main__":
    HomeToucherApp().run()

KV-郎:

<MainLayout>:
    orientation: 'vertical'
    padding: 20
    spacing: 10
    Button:
        text: "Screen"
        size_hint: 1, 1
    MenuLayout:
        cols: 2
        size_hint: 1, 0.1
        Button:
            text: "Edit"
        Button:
            text: "Setup"

日志:

C:\Python34\python.exe C:/Users/XXXXXXXX/ownCloud/Dev/exp/Lern1/main.py -m inspector
[INFO              ] Kivy v1.8.0
[INFO              ] [Logger      ] Record log in C:\Users\XXXXXXXX\.kivy\logs\kivy_15-04-02_63.txt
[INFO              ] [Factory     ] 157 symbols loaded
[DEBUG             ] [Cache       ] register <kv.image> with limit=None, timeout=60s
[DEBUG             ] [Cache       ] register <kv.atlas> with limit=None, timeout=Nones
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
[DEBUG             ] [Cache       ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG             ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600s
[DEBUG             ] [Cache       ] register <kv.lang> with limit=None, timeout=Nones
[INFO              ] [Text        ] Provider: pygame
[DEBUG             ] [Cache       ] register <kv.loader> with limit=500, timeout=60s
[INFO              ] [Loader      ] using a thread pool of 2 workers
[DEBUG             ] [Cache       ] register <textinput.label> with limit=None, timeout=60.0s
[DEBUG             ] [Cache       ] register <textinput.width> with limit=None, timeout=60.0s
[DEBUG             ] [App         ] Loading kv <C:/Users/XXXXXXXX/ownCloud/Dev/exp/Lern1\hometoucher.kv>
 Traceback (most recent call last):
   File "C:/Users/XXXXXXXX/ownCloud/Dev/exp/Lern1/main.py", line 20, in <module>
     HomeToucherApp().run()
   File "C:\Python34\lib\site-packages\kivy\app.py", line 765, in run
     self.load_kv(filename=self.kv_file)
   File "C:\Python34\lib\site-packages\kivy\app.py", line 585, in load_kv
     root = Builder.load_file(rfilename)
   File "C:\Python34\lib\site-packages\kivy\lang.py", line 1444, in load_file
     return self.load_string(data, **kwargs)
   File "C:\Python34\lib\site-packages\kivy\lang.py", line 1521, in load_string
     widget = Factory.get(parser.root.name)()
   File "C:\Python34\lib\site-packages\kivy\factory.py", line 118, in __getattr__
     raise AttributeError
 AttributeError

Process finished with exit code 1

0 个答案:

没有答案
相关问题