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.


    Outliner with drag/drop reordering - part 2

    Pythonista
    9
    594
    181792
    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.
    • cvp
      cvp @JonB last edited by cvp

      @JonB said

      This is where that better traceback library might shine -- we'd be able to see what row was trying to be accessed, how many rows were in the list in question, etc.

      I did not forget this traceback but not yet tested.

      When you delete a row, are you calling the tableview functions that tell the view that a row was deleted? Perhaps your datasource is getting updated before letting iOS know about it, such that it may have a query queued up for a scroll that is happening before you have let it know.

      Good question, I have to check

      Édit: I build the new data_source.items without the deleted one(s) and I call reload_data, that's all.
      I sincerely have always thought it was the right way.

      Edit2: in another case of deletion, I del self.tv.data_source.items[row] and reload_data.

      Another thing that could be helpful would be a decorator that you can decorate all functions with, that try/catch and reraise, after printing out what the current thread is. Things that operate on datasource have to be on the main thread.

      All that becomes too heavy for my poor knowledge.

      And as usual, thanks to spend time for us.

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

        @cvp If I execute the mac_outline_viewer in iTerm with python mac_outline_viewer.py, it works as expected and the file selector opens to my idrive outlines folder. But if I make the .py file executable and simply give its name in iTerm, it runs but the outline selector opens in the local Documents directory.

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

          @ihf sorry, I can't help you, I don't know anything in terminal/command mode of Mac OS.
          But remember that you can pass a path as program argument
          I'm sure that you will get help in this forum.

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

            If python3 mac_outline_viewer.py works on the macOS command-line then chmod +x mac_outline_viewer.py ; ./mac_outline_viewer.py should work exactly the same way. NOTE: The leading dot-slash (./) are REQUIRED.

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

              @ccc having also worked on UNIX, I should have remembered that ... thank you for us

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

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • cvp
                  cvp last edited by

                  Test to check if topic becomes normal instead of grayed

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

                    @cvp I don't see this topic in the list of topics but I seem to be able to get to it using a stored url. However I am also getting popups that say "You do not have enough privileges for this action".

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

                      @ihf said

                      the viewer does not show whether items are checked (completed) or dates which limits its utility.

                      • checked: done
                      • dates: how do you want the program shows them in the web page?
                      1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @JonB last edited by

                        @JonB said:

                        When you delete a row, are you calling the tableview functions that tell the view that a row was deleted? Perhaps your datasource is getting updated before letting iOS know about it, such that it may have a query queued up for a scroll that is happening before you have let it know.

                        In one case, I build the new data_source.items without the deleted one(s) and I call reload_data
                        in another case of deletion, I del self.tv.data_source.items[row] and reload_data.

                        Please, could you advice how to do it in a better way? Thanks

                        JonB 1 Reply Last reply Reply Quote 0
                        • ihf
                          ihf last edited by

                          @cvp There are 4 dates that are stored (created, updated, due, ended) and all are useful. Perhaps some way of specifying which one(s) are desired? Your question got me playing with the date and sorting items. It could be that this is working as it should but I don’t understand this result: https://i.imgur.com/FUTsj7F

                          cvp 2 Replies Last reply Reply Quote 0
                          • cvp
                            cvp @ihf last edited by

                            @ihf what don't you understand? Sorry but development is already far away ...

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

                              @ihf thé date is blank if not yet set, and the button at right of the title allows you to sort the items in ascending/descending/no order

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

                                @cvp I expected that the dates would be sorted. For example why is item 3.2 after 3.1?

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

                                  @ihf did you tap the sort button 🔽?

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

                                    @cvp I was certain I had but I went back to do it again just to be sure before I answered your question. Instead of confirming, I got the following error:

                                    Traceback (most recent call last):
                                      File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 1146, in layout
                                        ws,hs = self.get_screen_size()
                                      File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 1137, in get_screen_size
                                        app = UIApplication.sharedApplication().keyWindow()
                                      File "/var/containers/Bundle/Application/8778D1CF-1C08-48BA-9714-9D2CFE524EA1/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 801, in __call__
                                        ordered_args = list(args) + [kwargs[key] for key in kwarg_order]
                                    TypeError: 'builtin_function_or_method' object is not iterable ```
                                    
                                    I don’t think this has anything to do with the sorting question, since it appears even after I force quit Pythonista and start again.
                                    cvp 1 Reply Last reply Reply Quote 0
                                    • ihf
                                      ihf last edited by

                                      @cvp I got it to run again and , yes the display I posted is after hitting the sort button

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

                                        @ihf One of the usual Pythonista crashes for which, I think, my script is not responsible. I'm sorry for you and I would understand that you stop to use this program. It uses almost all internal functionalites of Pythonista, is big, uses a lot of memory, and crashes too much in not reproducible ways.

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

                                          @cvp I can live with occasional crashes. (Just wish that @omz would reappear or let someone have the source to Pythonista). In any case, does the sort order look right to you?

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

                                            @ihf did

                                            yes the display I posted is after hitting the sort button

                                            I don't think so, the sort button changes from 🔽 to 🔼 after you to it.

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