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
-
@cvp I tested as you suggested on the iPad which was having the problem with downloading the new releases and it worked. Not sure why this works since I had tried (on previous releases) to force quit Pythonista and restart it only to have it try to download the new release again, but happy to have it working now.
-
@ihf said
Not sure why this works since I had tried (on previous releases) to force quit Pythonista and restart it only to have it try to download the new release again
Perhaps did you force quit Pythonista after end of the script, which saves the script on file, even if not changed, it seems.
-
@cvp what is puzzling, but probably not worth pursuing, is why I get different behavior on the two iPads even though I’m doing exactly the same thing. In any case, it works now.
-
@ihf Life (and my programs 😂) always have a bit of a mystery
-
@ihf do you want a version that, just before the Pythonista abort, creates a local notification which should appear some seconds later. Tapping on this notification will automatically restart outline.py
-
Do some of you use outliner on iPhone?
On my iPhone 12 mini the application crashes when I create new entries continuously. Sooner or later an error appears (see Screenshot).
On my ipad 2020 the Problem does not occur. I use version 1.22.
-
@Bambla Unfortunately, not reproducible. Please, restart Pythonista itself and retry, sorry for you.
-
@Bambla I use outline on my iPhone and iPad all the time. I haven’t seen that problem .
-
@cvp I haven't tested it, but it looks like
https://github.com/andy-landy/traceback_with_variables
Should work with pythonista.This might provide some more useful tracebacks -- that traceback implies that kwargs got stomped on somehow. It could be useful to know what it was stomped with.
-
Thanks for the feedback. As soon as I find out more I will post it here.
-
@Bambla when such a problem occurs, you could check outLine.trace file, perhaps that could help to identify the problem, but not sure at all
-
@JonB said
traceback-with-variables
Be sure that I'm not a Python specialist and thaT I don't understand anything about this traceback, but, promised, I'll try it. Thanks to continue to try to help.
-
@cvp I was deleting a line from an outline (it may have had one child note) and got this:
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 575, in tableView_heightForRowAtIndexPath_ return tv_py.delegate.tableview_height_for_section_row(tv_py,section,row) File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 1250, in tableview_height_for_section_row vals,n,opts = tv.data_source.items[row]['content'] IndexError: list index out of range Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 575, in tableView_heightForRowAtIndexPath_ return tv_py.delegate.tableview_height_for_section_row(tv_py,section,row) File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 1250, in tableview_height_for_section_row vals,n,opts = tv.data_source.items[row]['content'] IndexError: list index out of range Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 2928, in tableview_cell_for_row hrow = self.tableview_height_for_section_row(tableview,section,row) File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 1250, in tableview_height_for_section_row vals,n,opts = tv.data_source.items[row]['content'] IndexError: list index out of range
-
-
Software development is just plain hard!!!
File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 1250, in tableview_height_for_section_row vals,n,opts = tv.data_source.items[row]['content'] IndexError: list index out of range
Here is what I would do... Go to line 1250 and see if you can make this change.
vals,n,opts = tv.data_source.items[row]['content'] # --> try: vals,n,opts = tv.data_source.items[row]['content'] except IndexError: print(f"{row = } but {len(tv.data_source.items) = }") raise
This should show you that
row
is off the end of the data source.Then look for all the places where
tableView_heightForRowAtIndexPath_()
is called and wrap them also:try: tableView_heightForRowAtIndexPath_(x, y, z, path) except IndexError: print(f"{path = }") raise
Keep the code between the
try
andexcept
as few lines as possible.Avoid like the plague that it is
try:
somethingexcept:
pass
. -
@ccc said
Software development is just plain hard!!!
Believe me, I know it, I personally have developed in a lot of programming languages during 40 years before I meet Python(ista).
I'll try your code, but I'm no more motivated because sometimes error come from ObjectiveC usage and I don't have access to what it does.Édit: That's what I said, this tableView_heightForRowAtIndexPath_() is never called by my code but by ObjectiveC code (I use @JonB 's swizzle for That).
Thus the error is not so obvious. Personally, I think that the error comes from the ObjectiveC calls.
-
@cvp It was delete with children via the pop-up menu. I am also seeing some problems with cursor being hidden but I will try to find a minimal failing case.
-
-
@cvp not sure, but certainly not something I've seen before.
-
@ihf sincerely, I only want to 😭