omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    New Beta for Pythonista 3.3

    Pythonista
    44
    98
    90262
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sulcud
      sulcud @omz last edited by

      @omz
      iPhone XS Max Pythonista keyboard never appears.

      Hi @omz about two days I upgrade my phone 6 to the xs max. In my iPhone 6 I have the actual beta of Pythonista and the keyboard words well, it appears and it let me ran my scripts, but now in the xs max the keyboard never appears or it appears but it looks like the standard iPhone keyboard and don’t show me any of the shortcuts, I have it enabled and I also try use it with the allow full access functionality but nothing.

      The specifications

      -iPhone XS Max 256gb
      -iOS 12.1.2
      -Pythonista 3.3 (330005) beta
      -PyKeys enabled
      -Full acces enabled (I turn it on to see if them works)
      -I also restart my device two times

      1 Reply Last reply Reply Quote 0
      • cvp
        cvp last edited by

        @omz If a Pythonista script is launched by Siri as background, it is executed even if Pythonista app is not in the apps list, but when the same script is launched by a notification, with foreground=False, it is only executed when I start Pythonista...
        Is this difference normal?

        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          @cvp said:

          Could it be possible to launch such a script by a home screen icon?

          That's not possible, I'm afraid. Home screen icons always launch the full app.

          @sulcud said:

          iPhone XS Max Pythonista keyboard never appears.

          That's weird, did you do a fresh install of the Pythonista beta on the XS Max, or did you restore a backup? Have you tried disabling the 'PyKeys' keyboard, and then enabling it again? Sorry, I don't have a good explanation right now.

          sulcud 1 Reply Last reply Reply Quote 0
          • sulcud
            sulcud @omz last edited by

            @omz I install Pythonista 3 from the backup them I install the beta, I try enabling and disabling pykeys

            1 Reply Last reply Reply Quote 0
            • sulcud
              sulcud last edited by

              @omz i solve it, i re install the app them i open it and them a install the beta

              1 Reply Last reply Reply Quote 0
              • sashk
                sashk @Guest last edited by

                @lpl said:

                @sashk And python 2.7.15

                Nope, Python 2 is dead. Use Python 3 instead.

                ? 1 Reply Last reply Reply Quote 0
                • sashk
                  sashk last edited by

                  @omz is there a shorctus module documentation? I dir'ed it and found what I was looking for, but documentation could have helped.

                  cvp 1 Reply Last reply Reply Quote 0
                  • cvp
                    cvp @sashk last edited by

                    @sashk

                    sashk 1 Reply Last reply Reply Quote 0
                    • sashk
                      sashk @cvp last edited by sashk

                      @cvp said:

                      Oh... on iPhone it's not very intuitive to find... :( Thanks though.

                      1 Reply Last reply Reply Quote 0
                      • omz
                        omz last edited by

                        @sashk In general, you tap on the (?) button in the console, or on the "Documentation" button in new tabs to get to the documentation. You can then search for shortcuts (or other module names) there.

                        1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User @sashk last edited by

                          @sashk said:

                          @lpl said:

                          @sashk And python 2.7.15

                          Nope, Python 2 is dead. Use Python 3 instead.

                          Specifically, 2.7 will receive bugfix support until January 1, 2020. Not yet, not now.

                          1 Reply Last reply Reply Quote 0
                          • ttobias
                            ttobias last edited by ttobias

                            @omz Would it be possible to add some basic Apple Watch support because Apple removed the Shortcuts app on the watch so there's currently no easy way to do some basic programmable stuff on the watch without Siri interaction, at least that I am aware off.

                            For example I have a shortcut which gets a json via a secret https url and formats the output nicely or another one which triggers same IoT actions.

                            It would be nice to do this with Pythonista.

                            General question: Does the TestFlight Beta override the installed app or is this separated?

                            dgelessus 1 Reply Last reply Reply Quote 1
                            • ihf
                              ihf last edited by

                              Some Apple Watch support would be a great addition and (as has been said) would help fill the void that Apple created when they replaced Workflow with Shortcuts.

                              1 Reply Last reply Reply Quote 1
                              • dgelessus
                                dgelessus @ttobias last edited by

                                @ttobias said:

                                General question: Does the TestFlight Beta override the installed app or is this separated?

                                The beta replaces the App Store version. If you already have the App Store version installed and then install the beta through TestFlight, you'll get a warning message saying that you may lose your data - this is generally not the case for Pythonista. (I've been in the Pythonista TestFlight beta since the beginning, and installing a beta has never overwritten my data. But if possible you should make an iTunes backup beforehand, just in case.)

                                You can also go back to the latest App Store release at any time, by going into your purchases and redownloading Pythonista there. This will replace the beta version, but also leaves your data intact (except perhaps for features that were introduced in the beta).

                                1 Reply Last reply Reply Quote 0
                                • jsamlarose47
                                  jsamlarose47 last edited by

                                  Just to say: the new keyboard is opening up some really exciting possibilities, and aside from everything else that Pythonista offers, this is the kind of functionality I've been wishing for on the iPad for a long time now. I've tried a number of third party keyboards to do more with text in iOS and the vast majority of them have proven disappointing, but this... there's more possible than all of those others put together. Happy days ahead. Hats off to OMZ.

                                  1 Reply Last reply Reply Quote 0
                                  • mithrendal
                                    mithrendal last edited by mithrendal

                                    New BETA crashes when I use the new introduced key_command feature

                                    Pythonista completely exists when pressing the a key on the external BT keyboard

                                    # coding: utf-8
                                    import ui
                                    import console
                                    
                                    class UIView (ui.View):
                                    	def get_key_commands(self):
                                    		print('get_key_commands')
                                    		return [{'input': 'a'}]
                                    		#return [{'input': 'a', 'modifiers':'cmd'}]
                                    		
                                    	def key_command(self,sender):
                                    		print('key_command='+str(sender))
                                    
                                    def main():
                                    	main_view = UIView(frame=(0, 0, 400, 400))
                                    	main_view.name = 'Key Commands Demo'
                                    	
                                    	main_view.present('sheet')
                                    	
                                    if __name__ == '__main__':
                                    	main()
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • omz
                                      omz last edited by

                                      @mithrendal I see thanks. I'll look into it tomorrow, but I think you might be able to move the main_view creation into the global scope (i.e. out of the main function) to make it work, but it's getting pretty late here, and my iPad is busy, so I can't really test this theory right now. I definitely had a working example (just not very pretty) when I posted the last beta.

                                      1 Reply Last reply Reply Quote 0
                                      • mithrendal
                                        mithrendal last edited by mithrendal

                                        Hi @omz ,
                                        if I move the main_view creation into the global scope (i.e. out of the main function) it also crashes.

                                        There is another issue with the newest BETA: When you create a custom view (extending ui.View) and add with the help of objc_util a native KeyCommandsView as a subview into that custom view. With the newest BETA that does not work anymore. Whereas it worked with the Beta before and with the current production version. I guess that you also added a KeyCommandsView into the ui.View and it consumes all key events, so the self-done-native way is not working anymore when using a custom view. When not extending the ui.View (e.g. using a pure ui.View) and adding the KeyCommandsView to it, the self-done-native way still works.

                                        Could you also do something for this second issue ?

                                        test case example of the second issue:

                                        # coding: utf-8
                                        from objc_util import *
                                        import ui
                                        import console
                                        UIKeyCommand = ObjCClass('UIKeyCommand')
                                        
                                        modifiers = {(1<<17): 'Shift', (1<<18): 'Ctrl', (1<<19): 'Alt', (1<<20): 'Cmd', (1<<21): 'NumPad'}
                                        
                                        def keyCommands(_self, _cmd):
                                        	keys =['A']
                                        	cmd_key_flag = 0
                                        	key_commands = []
                                        	for k in keys:
                                        		key_commands.append(UIKeyCommand.keyCommandWithInput_modifierFlags_action_(k, cmd_key_flag, 'keyCommandAction:'))
                                        	commands = ns(key_commands)
                                        	return commands.ptr
                                        	
                                        def canBecomeFirstResponder(_self, _cmd):
                                        	return True
                                        	
                                        def keyCommandAction_(_self, _cmd, _sender):
                                        	self = ObjCInstance(_self)
                                        	key_cmd = ObjCInstance(_sender)
                                        	flags = key_cmd.modifierFlags()
                                        	modifier_str = ' + '.join(modifiers[m] for m in list(modifiers.keys()) if (m & flags))
                                        	key_input = key_cmd.input()
                                        	console.hud_alert(str(key_input))
                                        		
                                        	
                                        KeyCommandsView = create_objc_class('KeyCommandsView', UIView, [keyCommands, canBecomeFirstResponder, keyCommandAction_])
                                        
                                        
                                        class CustomUIView (ui.View):
                                        	def will_close(self):
                                        		pass
                                        		
                                        @on_main_thread
                                        def main():
                                        	#this does not work anymore in latest Beta. E.g console.hud_alert('A') is not called anymore
                                        	main_view = CustomUIView(frame=(0, 0, 400, 400))
                                        	
                                        	#this still works. console.hud_alert('A') is called 
                                        	#main_view = ui.View(frame=(0, 0, 400, 400))
                                        		
                                        	v = KeyCommandsView.alloc().init()
                                        	v.becomeFirstResponder()
                                        	ObjCInstance(main_view).addSubview_(v)
                                        
                                        	main_view.present('sheet')
                                        	
                                        if __name__ == '__main__':
                                        	main()
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • caddtec
                                          caddtec last edited by

                                          Hi @omz,
                                          I have a weird bug... I was working on one of my projects with pyui files. I wanted to change the name of the component (a table view) and to my surprise it deleted the component. Actually, it deleted the component because of the backspace keystroke (since I wanted to change the name). Then I realized that also, any of the direction keys (up, down, left, right) weren’t working as well. All the other keys however are working. I then realized it was the physical keyboard that didn’t work in the pyui file. When I use the on-screen keyboard, everything works including the backspace. And only in the pyui fille display because if, for example, I try to use the backspace key from the physical keyboard from, let’s say the run text field (when you press a few seconds on the « play » icon), it’ll work.

                                          Let me know if you need more info.
                                          D

                                          1 Reply Last reply Reply Quote 0
                                          • mithrendal
                                            mithrendal last edited by mithrendal

                                            I tested the new BETA build 330012

                                            it still crashes when I use the in 330007 new introduced key_command feature

                                            Pythonista.app completely exists when pressing the 'a' key on the external BT keyboard

                                            # coding: utf-8
                                            import ui
                                            import console
                                            
                                            class UIView (ui.View):
                                            	def get_key_commands(self):
                                            		print('get_key_commands')
                                            		return [{'input': 'a'}]
                                            		#return [{'input': 'a', 'modifiers':'cmd'}]
                                            		
                                            	def key_command(self,sender):
                                            		print('key_command='+str(sender))
                                            
                                            def main():
                                            	main_view = UIView(frame=(0, 0, 400, 400))
                                            	main_view.name = 'Key Commands Demo'
                                            	
                                            	main_view.present('sheet')
                                            	
                                            if __name__ == '__main__':
                                            	main()
                                            

                                            @omz Do you still have some working example code of the new keycommand API ?

                                            EDIT: OMZ wrote me. Although title is optional as written in the documentation, it must be set in the BETA otherwise it crashes.

                                            so the statement

                                             return [{'input': 'a', 'title': 'a'}]
                                            

                                            repairs keycommands for the BETA. It will be fixed in the coming builds...

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors