@Blanchot So true.
@mikael your new job colleagues will be very happy as they get a high skilled and very talented work mate with you!!! Wish you a happy time on your new journey.
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.
@Blanchot So true.
@mikael your new job colleagues will be very happy as they get a high skilled and very talented work mate with you!!! Wish you a happy time on your new journey.
Hello Ole,
I am back on the app store version again. Why not just release the last beta to the app store? It was pretty stable. Come on don't be shy and just push the button !
;-)
I like the intuitive and simplistic API approach as always when mikael comes out with a new thing ;-) Next time I have a need for parallel execution in my code I will definitly come back to genr ...
the beta expired. I did not delete it ! I just reinstalled the old appstore version. After the download completed, now pythonista starts again. All my data was still there.
Hi @Lacajenne
Is it one of the new iPads Pros with bigger screens ? When I remember correctly the current version on the app store is not so compatible with the new screen sizes from the new iPads. A new beta version is already available since late december which fixes this. You could download it, just watch out for the thread about the new Pythonista 3.3 BETA or you have to wait and have a bit patience it should be out sometime soon.
you could setup a custom view and overwrite the will_close method, maybe you also like to know when the view is fully loaded...
I have copied the appropiate code from the docs http://omz-software.com/pythonista/docs/ios/ui.html for you
import ui
class MyView (ui.View):
def did_load(self):
# This will be called when a view has been fully loaded from a UI file.
pass
def will_close(self):
# This will be called when a presented view is about to be dismissed.
# You might want to save data here.
pass
@ccc the last line does not close the server socket itself. It only closes the just accepted connection. The client also closes immediately after sending "some data". So no reason to not close the connection on server side.
Anyway @bennr01 did only write this as some short demonstration ... In real world you would probably hold the connection open over the whole game session ....
Hi @mikael,
Yes that looks promising. I just uploaded my work on this for you at github. It doesn't crash and is completely reentrant. The idea was to make an simple API which games and other apps can import. But I did not work on it recently. When I saw your post that you too want to build an API I thought you might want to have a look. https://github.com/mithrendal/pythonista_mpc
Btw I am a big fan of your Gestures.py API 😀
Hi Mikael,
had the same problem. The crash was caused by the garbage collection which is triggered automatically somewhen when python wants to delete the invitationHandler.
My approach/workaround was not to get it deleted by remembering its reference. That way the garbage collector will not call delete on it.
instead of
blk.invoke(ObjCInstance(invitationHandler),True, ObjCInstance(mySession))
try
inviHandler = ObjCInstance(invitationHandler)
someglobalscopeobject.remember_this_thing=inviHandler
blk.invoke(inviHandler,True, ObjCInstance(mySession))
my guess was that something in the MPC framework still holds the reference and uses this invitation handler but the pythonista garbage collector does not know this because it only knows about references in your python programm. Thus when the python gc deletes it, and after that something in the apple mpc framework wants to call it, it will inevitably crash.
EDIT:
instead of someglobalscopedobject you could also use something like that to make it able to be reentrant
import builtins
...
inviHandlerObj = ObjCInstance(invitationHandler)
if (builtins.retainCache == NONE):
builtins.retainCache = [ ]
builtins.retainCache.append(inviHandlerObj)
blk.invoke(inviHandlerObj,True, ObjCInstance(mySession))
...