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 run it in iTerm but I suppose if I put it on my webserver I could run it in a browser tab but it would need to be modified to put out html. Not so?
-
@cvp also the viewer does not show whether items are checked (completed) or dates which limits its utility.
-
@cvp I just realized that I am running v.01 not v.02 which has html. But if I go to Github, I don't see v.02?
-
-
@cvp I'm using the link in your post above: https://github.com/cvpe/Pythonista-scripts/blob/7a0ea85d3f0b7c0def0eb4472aac2ac099730bc3/Gists/mac_outline_viewer.py and this takes me to v.01
-
@ihf you are righT and I don't understand why it links to an old version, but I have to say I don't know a lot about GitHub, sorry
Please, use https://github.com/cvpe/Pythonista-scripts/blob/master/Gists/mac_outline_viewer.py
-
@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