Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Pythonista 1.6 Beta
-
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.
-
Hehe I figured I'd dig up a way, so shortly after the post I did find out about tel:, callto: mailto: etc.
I think it might be that i am not using an iPhone (why tel: doesn't show an option for calling) I think that will do though.
Can't wait to see a full feature list for 1.6!
-
Can the new dialogs be used as popups in ui like console alerts can? I'm about to try so I guess I'll be able to answer my own question.
-
What happens if I get added? Will it be listed as an update, etc... I sent an email.
-
@henrii Apple sends you an email telling you what to do.
-
I have tested the latest update cb module with my LightBlue Bean and things are working well. I was able to write an Arduino sketch that sends data out on several characteristics and read the data on the iPad. Updates to the characteristics on the Bean are picked up as they occur on the iPad. I have not validated that the serial data transfer (GATT) characteristic is working properly yet, it is not documented very well.
I am not seeing any exceptions or other flaky behavior.
I will be moving on to talking to multiple devices next to see how it scales.
-
Selecting an action from the action menu closes the keyboard and clears the cursor position.
I have a number of scripts that use editor.get_selection() that do not work correctly now as when they run this value is not set. I suspect this is also causing some of my scripts that use the selection to crash pythonista.
Not to mention that it is annoying to have to re-open the keyboard after performing an action. -
There does not seem to be a way to set a tint or background color to transparent in the ui editor's new color picker.
-
@OMZ: Is it possible to change the ui editor's color picker to alternatively manually enter the color code?
-
Is it possible to change the ui editor's color picker to alternatively manually enter the color code?
I'll see what I can do, currently not possible.
There does not seem to be a way to set a tint or background color to transparent in the ui editor's new color picker.
Yes, that's currently not possible either (unless you want a fully-transparent background, in which case you can use the "⧄" button). I'll think about how to add the possibility of setting an alpha value in the new UI.
Selecting an action from the action menu closes the keyboard and clears the cursor position. I have a number of scripts that use editor.get_selection() that do not work correctly now as when they run this value is not set. I suspect this is also causing some of my scripts that use the selection to crash pythonista. Not to mention that it is annoying to have to re-open the keyboard after performing an action.
Are you referring to the iPhone or iPad version? I would also be very interested in a script that reproducibly crashes when using the editor selection.
-
Today I decided to switch from my Bean BLE device to a MIDI interface. I figure that a MIDI keyboard should really stress out the system since it can easily generate one shot data or whole streams. Luckily the device seems to work well and I can send and receive MIDI data to it from a script and the cb module.
I have noticed one with this device. You can pretty easily get the "connection" into a bad state by exiting the script and not formally closing it. I added the following code to the sample and it seems to cure the problem.
try: while True: pass except KeyboardInterrupt: print 'keyboard interrupt - resetting' if mngr.peripheral != None: cb.cancel_peripheral_connection(mngr.peripheral) cb.reset()
I have been assuming that cb.reset would close any open connections but that must not be the case. Does the Peripheral object have logic to close an open connection?
Also - I am not yet an expert on Bluetooth LE, but I have read up enough on it to know that the whole concept of connections and how they work is complex. There are various timeouts in place to close down open connections that you may have to set as you work with the core api's. Might be a good idea to review that.
-
Here is my script that crashes unless I remove any reference to sel. So that's just a guess by me of the cause.
import editor import os from time import sleep dbname = 'swap.txt' if __name__ == '__main__': fname = editor.get_path() sel = editor.get_selection() try: dbfile = open(dbname,'r') newf = dbfile.readline().strip() #strip off the newline character. poss = dbfile.readline() pos = int(poss) dbfile.close() editor.open_file(newf) sleep(0.5) #wait a bit for the file to open. editor.set_selection(pos, pos) except: pass pos = 0 if sel == None else sel[0] data = [fname, '\n', str(pos)] dbfile = open(dbname,'w') dbfile.writelines(data) dbfile.close()
-
@Gcarver I see, thanks! Does it also crash if you increase the sleep interval to something like 1.5 or 2.0 seconds (just to be sure). It obviously shouldn't crash either way, but if it goes away with a longer interval, that would confirm the suspicion I have about the reason for this.
-
Before I descend down the rabbit hole, I am warned I might lose my data. True or false? If true, how to back up my goodies?