Pythonista 1.6 Beta
-
So, with Apple's new TestFlight, I can finally have a lot more beta testers, and won't have to worry about device limits so much.
If you'd like to play with the next version of Pythonista before it hits the App Store, please send me an email with your Apple ID, and I'll see what I can do. I don't plan to use up all the slots yet (I might need some later), but if you've been posting here, there's a very good chance that I can give you access to the beta.
As for what to expect, here's a list of the new features in the current beta:
- Improved support for the iPhone 6 and 6 Plus screen sizes
- Removing files from the library moves them to a trash folder instead of deleting them immediately.
- URLs in console output are 'linkified' automatically
- New
reminders
module for accessing the iOS Reminders database (read/write) - New
cb
module for connecting to Bluetooth LE peripherals (experimental) - New dialogs module as an easy-to-use alternative to the ui module when you just need simple data entry. This also contains functions to import files from the iCloud Drive document picker (iOS 8 only). – note: this is broken in the current beta, but will be fixed in the next few days
Anyone?
-
@andymitchhank Hmm, that does sound like a bug indeed. Which version of iOS are you using?
-
8.1 on an iPad 3 and iPhone 6 Plus. Both are having the same issue.
-
@andymitchhank Thanks, I've been able to reproduce the issue. Apparently this has to do with some new requirements for location permissions in iOS 8, looking into it.
-
I am still working on reproducing an issue that occurs in one of the callbacks in the cb module. What happens is some kind of heap corruption when I call functions in other modules. I was writing some code that used str.append() and getting all kinds of wierd behavior. It looks like either heap corruption or blown stack.
Trouble started when I modified the code trying to print out returned values in a characteristic. I used (print c.value.encode('hex')) in two callbacks and it did not "work". The program just printed nothing but also just returned from the callback and stopped working.
I could use a few hints on how to get a good repro case. I could post my code, but the effect is random and the code needs to access a specific device. Any ideas on how to stress the heap or stack in this callback environment would be appreciated.
-
And how does one find OMZ's e-mail address? happy to help.
-
Click on the word "email" in the very first post in this thread... It is a hyperlink.
-
ui.TableView.row_height seems to always be -1 for me. This is new behavior. I can provide repro code if you need it.
-
Trying to make a table action so when you select a row it checks off the reminder, is this how that logic would work?
def picked(sender): r.title = sender.data_source.items[row] if r.title in reminders.get_reminders(completed=False): print 'good' r.completed = True
-
ui.TableView.row_height seems to always be -1 for me. This is new behavior. I can provide repro code if you need it.
Thanks, should be fixed in the build after the next one (already uploaded that).
Trying to make a table action so when you select a row it checks off the reminder, is this how that logic would work?
I can't see where
r
is coming from in that example and why you would set its title when you actually want to set its completion state.
-
Sounds great! Just send you an email (or two--sorry)
-
@techteej Here's a very simple example of a table view UI to check off reminders:
import reminders import ui def table_action(sender): item = sender.items[sender.selected_row] r = item['reminder'] r.completed = True r.save() del sender.items[sender.selected_row] def main(): v = ui.TableView() v.frame = (0, 0, 500, 500) v.name = 'To Do' all_reminders = reminders.get_reminders(completed=False) items = [{'title': r.title, 'reminder': r} for r in all_reminders] data_source = ui.ListDataSource(items) data_source.action = table_action v.data_source = data_source v.delegate = data_source v.present('sheet') main()
-
Has anyone else seen this.
I can't install 1.6 because when I click on "Open in Testflight" when reading the apple invite email in gmail it insists on opening iTunes on the Testflight page. When I click on "OPEN" Testflight then says I have to click the link in the email. Has anyone else been able to install from gmail? Is this a gmail bug? I haven't configured apple email so I can't click the link from there.
Any suggestions?
Edit: Solved it. It was Chrome. Gmail launches Chrome to resolve urls. It required cut and paste of the link from Crome to Safari.
-
@zencuke Maybe try copying the link from Gmail and then pasting it in Safari?
-
Still reading the doc. (Actually I connected with the SensorTag and my heart rate monitor first ;-) ) Thanks for Reminders. I didn't realize how much useful functionality (Calendars, Alarms, even geo-location alarms) that included.
Reminders question: This may be a limitation in the apple framework but would it be possible to add an action_url to reminder alarms like there is in the notifications module? It would be nice to implement custom behavior when an alarm happens, from snooze to marking a reminder as done or even changing the reminder contents.
-
Reminders question: This may be a limitation in the apple framework but would it be possible to add an action_url to reminder alarms like there is in the notifications module?
No, that's technically impossible. The notifications are entirely handled by the built-in Reminders app.
-
Alright, a few more things I noticed. Some of these were already present in 1.5 or are suggestions, but I suppose it doesn't make any difference now that the beta is available to a few people.
- [major] It is no longer possible for action menu scripts to open
input_alert
s and such. Instead the script will forever hang and cannot be stopped without killing Pythonista. - [major]
password_alert
always returns None. - [major unless you read the source code] In the documentation for
dialogs.form_dialog()
there is no mention of the"title"
dictionary key. - [minor] When viewing a non-Python text file it is not possible to edit the action menu list.
- [minor]
site
builtinscopyright
,credits
,license
,exit
andquit
are missing. (The last two are not very important in Pythonista though.) - [minor] In the tap-and-hold menu of the console's Clear button, the Clear Output button does nothing.
- [visual] Still no line break after the
EXIT (n)
output caused bySystemExit
s. - [visual] The console ignores
sys.ps1
andsys.ps2
, and always uses>>>
and...
instead. - [suggestion] Perhaps also add the "New Folder" option to the "create" menu of the file list, so folders can be created without needing to go into edit mode.
- [suggestion] Perhaps make editor scripts available from the "share" button in the console in addition to that in the editor.
- [suggestion] When entering multiline statements (if, def, etc.) in the console, didn't the ">" previously change to "..."?
- [suggestion] When entering multiline statements in the console, change the "play" button to "cancel", so that KeyboardInterrupts can be sent to cancel statements mid-input.
PS - Simple test for
console
-related bugs:import console def main(): try: print(console.alert("alert", button1="OK")) print(console.input_alert("input_alert")) print(console.password_alert("password_alert")) except KeyboardInterrupt as ki: print(ki) if __name__ == "__main__": main()
Works as a main script, but hangs when added and run as an editor script. Both methods worked fine in 1.5.
- [major] It is no longer possible for action menu scripts to open
-
Are all features that will be included in the final release included in the beta?
It would be nice to have a phone module. And I have been wanting some way to interact with facebook (mainly for editorial).
-
@dgelessus Thanks a lot, some very good points there.
Are all features that will be included in the final release included in the beta?
Yes. I have more things in the pipeline, but probably not for 1.6.
It would be nice to have a phone module. And I have been wanting some way to interact with facebook (mainly for editorial).
Not sure what you'd expect a hypothetical
phone
module to do. There isn't much phone-related stuff that is accessible from third-party apps.
-
@TutorialDoctor, you might want to look up tel:// URLs. They are supported by practically all smartphone operating systems, and on iOS I believe they can be used for FaceTime calls on non-iPhones as well. Skype also understands the callto:// protocol, but that appears to be mostly Microsoft-specific. In any case they are normal URLs and can thus be opened using
webbrowser
.
-
@omz Bug,when archiving a folder to send as an email, the email share sheet is never presented.