Я начал изучать фреймворк Kivy, прочитав «Создание приложений в Kivy» Дасти Филлипса.Я сделал все, как говорится в книге, и я подумал, что я также понимаю, что я делаю, но затем я столкнулся с «ParserException».
Это мой код:
WeatherRoot:
<WeatherRoot>:
AddLocationForm:
<AddLocationForm>:
orientation: "vertical"
# Set a value for the property that was created in the .py file.
search_input: search_box
search_results: search_results_list
BoxLayout:
height: "40dp"
size_hint_y: None
TextInput:
# Define an id for the widget so that it can be referenced
# from elsewhere in the KV file
id: search_box
size_hint_x: 50
multiline: False
# on_text_validate: root.search_location()
Button:
text: "Search"
size_hint_x: 25
on_press: root.search_location()
Button:
text: "Current Location"
size_hint_x: 25
on_press: root.search_location_by_coordinates()
ListView:
id: search_results_list
item_strings: []
После добавления WeatherRoot:
корневого виджета и <WeatherRoot>:
правила класса код сломался.Перед тем как добавить код работал нормально.
Вот ошибка, которую я получаю:
kivy.lang.parser.ParserException: Parser: File "c:\Users\Utente-
006\Dropbox\Programming\rss-reader\weather.kv", line 8:
...
6: AddLocationForm:
7:
> 8: <AddLocationForm>:
9: orientation: "vertical"
10: # Set a value for the property that was created in the .py file.
...
Invalid class name