在测试执行kivy的示例:app_suite.py的时候,误把<Prebuilt>写成<PreBuilt>然后就报错如下:
[INFO ] [Logger ] Record log in C:\Users\asus\.kivy\logs\kivy_23-07-22_72.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.3.3
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.3
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.1
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.6.0
[INFO ] [Kivy ] v2.2.1
[INFO ] [Kivy ] Installed at "D:\code\luncher\python3910\lib\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "D:\code\luncher\python3910\python.exe"
[INFO ] [Logger ] Purge log fired. Processing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 190 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
Traceback (most recent call last):
File "D:\code2\vegetabledog\kivy_app\app_suite\app_suite.py", line 73, in <module>
class TestPreBuildApp(App):
File "D:\code2\vegetabledog\kivy_app\app_suite\app_suite.py", line 76, in TestPreBuildApp
Builder.load_string(kv)
File "D:\code\luncher\python3910\lib\site-packages\kivy\lang\builder.py", line 372, in load_string
parser = Parser(content=string, filename=fn)
File "D:\code\luncher\python3910\lib\site-packages\kivy\lang\parser.py", line 483, in __init__
self.parse(content)
File "D:\code\luncher\python3910\lib\site-packages\kivy\lang\parser.py", line 593, in parse
objects, remaining_lines = self.parse_level(0, lines)
File "D:\code\luncher\python3910\lib\site-packages\kivy\lang\parser.py", line 696, in parse_level
_objects, _lines = self.parse_level(
File "D:\code\luncher\python3910\lib\site-packages\kivy\lang\parser.py", line 766, in parse_level
raise ParserException(self, ln,
kivy.lang.parser.ParserException: Parser: File "<inline>", line 3:
...
1:<PreBuilt>
2: Button:
>> 3: text:'hello from TestPrebuiltApp'
...
Invalid indentation (too many levels)