I am using an app called Pythonista on my iPhone. It functions much like any Python IDE but with a few additional features to account for the fact that is on iOS. It has a module called "dialogs" which is an objective-c wrapper for different UIs. One of them is called a form dialog, which is a UI with multiple text fields that are configured by a dictionary. The documentation for this module is online, if you search for 'pythonista dialogs module'.
My form dialog has text fields for address input (one for street, one for city, and one for state). When you put in your address, the results are fed into the location module, which converts them to geocode. It has always worked in other scripts.
Now, I am trying to make a script that uses a UI to add reminders, via a module that provides access to the iOS reminders app. To add a custom location for a location based alarm, I am using this form, which then uses the geocode for the reminder.
The form dialog is returning None, no matter what is entered into it. I assigned it a variable and used it in the same way that has worked before. I had a friend who is extremely good at Python check the script, and he found nothing wrong. When I run just the part that takes the address and converts it to geocode in the console, it appears to work perfectly, but in my reminder script, it only returns None.
There appear to be no errors with the script, which looks like this:
if self.locationlist.selected_row == (0,5):
self.wait_modal()
a = reminders.Alarm()
address_dict = dialogs.form_dialog('test', [{'title': 'Street', 'type': 'text'},
{'title': 'City', 'type': 'text'} ,
{'title': 'State', 'type': 'text'},
{'title':'Country', 'type': 'text', 'value': 'USA'}])
results = location.geocode(address_dict)
if self.radiusswitch.selected_index == 0:
a.proximity = 'enter'
if self.radiusswitch.selected_index == 1:
a.proximity = 'leave'
lat = results[0]['longitude']
lng = results[0]['latitude']
radius = 500
reverse = location.reverse_geocode(results)
title = reverse[0]['street']
a.location = (title, lat,lng)
v.r.alarms = [a]
v.r.save()
Is there any reason why the form might be returning None?