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 Yes, I can run that in iTerm (or using the Python Launcher) and I get the outline in a browser tab.
-
-
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.
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.
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.
-
@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.
-
@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.
-
@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. -
If
python3 mac_outline_viewer.py
works on the macOS command-line thenchmod +x mac_outline_viewer.py ; ./mac_outline_viewer.py
should work exactly the same way. NOTE: The leading dot-slash (./
) are REQUIRED. -
@ccc having also worked on UNIX, I should have remembered that ... thank you for us
-
This post is deleted! -
Test to check if topic becomes normal instead of grayed
-
@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".
-
@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?
-
@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
-
@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
-
@ihf what don't you understand? Sorry but development is already far away ...
-
@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
-
@cvp I expected that the dates would be sorted. For example why is item 3.2 after 3.1?
-
@ihf did you tap the sort button 🔽?
-
@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 I got it to run again and , yes the display I posted is after hitting the sort button