Errata

Creating Apps in Kivy

Errata for Creating Apps in Kivy

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
ePub
Page Cover
Cover

The cover does not appear for the book in both kindle and eppub for OS X. It is just a blank square.

Christopher Webb-Orenstein  Feb 12, 2014  Apr 08, 2014
ePub
Page Cover
Cover

The cover does not appear for the book in both kindle and eppub for OS X. It is just a blank square.

Christopher Webb-Orenstein  Feb 12, 2014  Apr 08, 2014
ePub
Page Example 2-8
Example 2-8

Missing instruction to add the following statement:

from kivy.network.urlrequest import UrlRequest

Note from the Author or Editor:
This definitely can be clarified. There's already an "IMPORT" section in the book. It should be sufficient to add a new example just before the [[get_map_data.py]]:

-----------------------------------------------------------
[[get_map_import.py]]
.Import UrlRequest
====
[filename="code/3-08_get_map_data/main.py", language="py", identifier="IMPORT"]
snippet~~~~

snippet~~~~
====

---------------------------------------------------------------

Also change the sentence

As <<get_map_data.py>> illustrates, this is not a difficult task.(((buttons, Search button)))

to

This is not a difficult task. First import +UrlRequest+ as shown in <<get_map_import.py>> and request the URL as illustrated in <<get_map_data.py>>.(((buttons, Search button)))

---------------------------------------------------------------

This should be sufficient, but make sure to double check the editing and formatting. :-)

Anonymous  Mar 26, 2014  Aug 22, 2014
Printed
Page 1
.

"While I hope this book appeals to a diverspe array of developers..."
should be:
"While I hope this book appeals to a diverse array of developers..."

Note from the Author or Editor:
I've changed this in the git repository already. The first page of chapter 1 does indeed include a typo in the repo, but it doesn't exist in the older print version I have. Please change diverspe to diverse.

Anonymous  Nov 17, 2014 
PDF
Page 10
Chapter 1, in The KV Language Root Widget section, bottom of page

In the following sentence, "Language" is mis-spelled:

The KV Lanuage is a special domain specific language that is ideal for laying out user interfaces.

Note from the Author or Editor:
This has been fixed already.

Mike Driscoll  Mar 28, 2014  Apr 08, 2014
Printed, PDF, ePub, Mobi, , Other Digital Version
Page 13
4th point of code

Respected sir
I started learning kivy with the help of your book. Everything was going well but when i encountered listview code I got an error. The error says that listview class is not found. i searched on the internet about it and i got to know that it is removed in the stable version of kivy. Now I am hanging in the part of the listview code while creating the weather app due to which i am not able to proceed with your book!
I request you to provide me an alternative code for listview so that i can continue my learning.
Thank you

Note from the Author or Editor:
listview was removed in kivy 2.0. I'm afraid I'm not familiar with the new Kivy, but it appears to have been replaced with RecycleView: https://stackoverflow.com/questions/56601384/kivy-unknown-class-listview-error-code
I suggest the kivy discord or user groups for further information. they are a super helpful bunch! https://kivy.org/#support

Anonymous  Mar 17, 2021 
PDF
Page 27
example

From a reader:

I bought and am reading your book "Creating Apps in Kivy," he is very good but as my language is Portuguese (Brazil) I had to change a little detail of your code to find cities with characters in UTF-8:
Chapter 2, page 27:


import urllib
def search_location(self):
text = urllib.parse.quote_plus(self.search_input.text)

Dusty Phillips
Dusty Phillips
 
Jul 11, 2014 
Printed
Page 28-

In the first example that uses OpenWeatherMap it now appears that access to the data is limited. If you run the url request in a browser you get an error message containing a link. Following the link leads to more information which in turn leads you to a page where you can register, at no cost, for an APPID. You can then include this APPID in requests.

So the request in the book
"http://api.openweathermap.org/data/2.5/find?q={}&type=like"

becomes

"http://api.openweathermap.org/data/2.5/find?q={}&type=like&APPID="+ appidkey

where appid contains the given APPID.

Note from the Author or Editor:
I've confirmed the issue; openweathermap has changed their query process and the urls in the book are now all broken. This is going to utterly ruin the reader experience for all new readers; we'll need to do an update and should maybe talk about a second edition.

David Whiteley  Nov 09, 2015 
PDF
Page 28
last paragraph

def found_location(self, request, data):
cities = ["{} ({})".format(d['name'], d['sys']['country'])
for d in data['list']]

the API changed, there is no data['list']... So the comprehension fails. I guess this will generate errors further in the book.

Changed it to
cities = ["{} ({})".format(data['name'], data['sys']['country'])]
for now.

Andre van der Vlies  Dec 17, 2018 
PDF
Page 32
Figure 2-1

Unfortunately, it seems for some reason openweathermap no longer returns results for Vancouver, US when search for 'Vancouver'. They still return multiple results for, say, "London". For Vancouver,US, seems that the API now requires the country code as well.

Current (May 26, 2014 18:20) API results:

- Vancouver (returns on Vancouver Canada result)
http://api.openweathermap.org/data/2.5/find?q=vancouver&type=like
{
{
message: "like",
cod: "200",
count: 1,
<skip>
}

- London (returns multiple results)
http://api.openweathermap.org/data/2.5/find?q=London&type=like
{
{
message: "like",
cod: "200",
count: 4,
<skip>
}

- Search for Vancouver, US with country code
http://api.openweathermap.org/data/2.5/find?q=vancouver,us&type=like
{
message: "like",
cod: "200",
count: 1,
list: [
{
id: 5814616, (as oppose to ID 6173331 of Vancouver CA)
<skip>
}

Note from the Author or Editor:
This error is not in the book, but in the API the book uses. I have tried to find a way to report the bug upstream but was unable to do so. We should change the image on page 32 and the text on page 31 to say London instead of Vancouver so that the example actually works with the API. The image has "Vancouver" in three places, and the text has it in the last paragraph before the warning on page 31.

Eric Chou  May 26, 2014  Aug 22, 2014
PDF
Page 32
last paragraph

As the OpenWeather API changed a bit (e.g. the need foor an appid and a different output formar(?) ) I changed the AddLocationForm class a bit.

from StringIO import StringIO
import gzip
import json



class AddLocationForm(BoxLayout): #
search_input = ObjectProperty()
search_results = ObjectProperty()

def search_location(self):
search_template = .......://bulk.openweathermap.org/sample/city.list.json.gz"
request = UrlRequest(search_template, self.found_location)

def found_location(self, request, dat):
city = "{}".format(self.search_input.text)
data = json.load(gzip.GzipFile(fileobj=StringIO(dat)))
# This is case sensitive...
cities = ["{} ({})".format(d['name'], d['country']) for d in data if d['name']==city]
self.search_results.item_strings = cities
del self.search_results.adapter.data[:]
self.search_results.adapter.data.extend(cities)
self.search_results._trigger_reset_populate()


No need for an appid and (yummie) a list comprension again... My guess is that further on some adjustment gave to be made for real weather....

Andre van der Vlies  Jan 06, 2019 
Printed
Page 37
Example 3-5.

In example 3-5 on page 37 the book describes why the 'clear' method is used inside the adapter for ListAdapter widgets.

The book uses the 'clear' method to clear the adapter before populating it:

self.search_results.adapter.data.clear()

However this fails when running the script with the error:

File "main.py", line 23, in found_location
self.search_results.adapter.data.clear() # <1>
AttributeError: 'ObservableList' object has no attribute 'clear'


Can you tell me if this method is already redundant?

Note from the Author or Editor:
The reader is right, this is confusing. The error is happening because they are using Python 2, but this is Python 3 syntax.

There is already clarification in the sidebar on page 39. However, this is two pages too late. Perhaps we can rearrange the positioning of the sidebar? Or else add a note to the #1 callout on page 37, as "Note: This won't work on Python 2, see the sidebar on Page 39"

Nicholas Herriot  Dec 02, 2014