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
-
@cvp working again (probably neglected to restart) . Ignore that comment about paste being uncertain
-
-
@ihf Some questions relative to possible improvements:
- Do you want to see that a due date is already set, for instance by a clock in the checkbox?
- For the actions delete with children from general popup menu and delete/cut selected rows, do you want that I automatically delete the eventual calendar events, without feedback because could be several such rows?
- For paste operation, do you want I automatically create a calendar event for each row where due date exists, without feedback because could be several such rows?
- As outline of a row can vary frequently by renumbering when you promote/demote or add a row before, we could not store this outline in the event title, keeping only file name and text of the row?
- If you use a lot an external keyboard, are you interested to define keys combinations for more actions, like 'font attributes' or some options of popup menu?
I had promised to debug the undo process previous week, but I have been fully occupied by copy/paste and other things. Thus, I apologize and I'll try next week. Not this week-end because the week-end is fun only, thus only new functionalities 😀
-
@cvp I would say YES to all 5 of your questions. I obviously have to work harder to think of new features because you are coming up with great ideas faster than I am :-)
-
@cvp I was just typing into an outline and got this:
Traceback (most recent call last): File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 869, in __call__ argtypes = kwargs['argtypes'] KeyError: 'argtypes' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 3686, in tableview_reload_one_row self.tvo.reloadRowsAtIndexPaths_withRowAnimation_([nsindex], UITableViewRowAnimationNone) File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 878, in __call__ args = tuple(_auto_wrap(a, argtype_encodings[i], argtypes[i+2]) for i, a in enumerate(args)) File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 878, in <genexpr> args = tuple(_auto_wrap(a, argtype_encodings[i], argtypes[i+2]) for i, a in enumerate(args)) File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 695, in _auto_wrap return ns(arg) File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 1007, in ns arr = NSMutableArray.array() File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 727, in __call__ ordered_args = list(args) + [kwargs[key] for key in kwarg_order] File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 727, in <listcomp> ordered_args = list(args) + [kwargs[key] for key in kwarg_order] TypeError: unhashable type: 'dict' ```
-
-
@ihf said:
Traceback (most recent call last):
File "/var/containers/Bundle/Application/BD1F4CA5-69E3-4F62-BEFE-2AD2B2CD0813/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 869, in call
argtypes = kwargs['argtypes']
KeyError: 'argtypes'I already got that too when I perform multiple runs without restarting Pythonista. I don't think the solution is in my hands if it is not reproducible on demand.
-
If you use a lot an external keyboard, are you interested to define keys combinations for more actions, like 'font attributes' or some options of popup menu?
Up to you to define keys combinations and their actions. Or perhaps I could do that dynamically but it seems more complex
-
Version V00.89 - identify outlines of which due date is set by a light green background - outline no more stored in calendar event title, only file name and text - delete eventual calendar event of all outlines deleted by 'delete with children' - delete eventual calendar event of all outlines deleted by 'delete/cut selected' - add eventual calendar event of all outlines added'by 'paste' nb: events are added/deleted without any feedback because could be multiple - correction of bug "error if action delete/cut/copy but no outline selected"
-
@cvp This has nothing to do with Outline and it may have been reported elsewhere but there appears to be a bug in Pythonista such that if you run Pythonista and leave it (but not kill it) and then try to run a script via the pythonista3:// URL, Pythonista will crash. I noticed this because I am using a trivial shortcut to select the outline I want to open and if Pythonista was used and exited, the shortcut opens Pythonista and it crashes immediately.
-
@ihf You know that the script became very long and I remark that I can't even run it twice anymore in the same Pythonista run, if I leave it for one minute. Memory problem?
-
@cvp
Is that self.tvo.reloadRowsAtIndexPaths_withRowAnimation_
method being called on the main thread? It probably needs to be.Alternatively, you might try explicitly calling ns([nsindex) and setting to a variable, rather than letting auto_wrap handle it. I can't think why that would matter, but you might end up with a clearer stacktrace.
Also, it would let you wrap a try/except around the ns() itself, and print out nsindex in the cases where you get an error. Maybe nsindex is the wrong type, etc.
-
@JonB said:
reloadRowsAtIndexPaths
Code is
def tableview_reload_one_row(self, row): self.cursor = (row,0) # not needed else if reload done #print('tableview_reload_one_row',row) NSIndexPath = ObjCClass("NSIndexPath") nsindex = NSIndexPath.indexPathForRow_inSection_(row,0) UITableViewRowAnimationNone = 5 #self.tvo.beginUpdates() self.tvo.reloadRowsAtIndexPaths_withRowAnimation_([nsindex], UITableViewRowAnimationNone) #self.tvo.endUpdates()
method being called on the main thread?
It is not but I don't think it needs to be
And don't forget this problem does not occur frequently but only after we run the script several times in the same Pythonista run...
Anyway, I'll follow your advices:
- main thread
- try/except
For your info, if I force index to be bigger than table length, I don't have any Python error but an ObjectiveC crash with
The app was terminated due to an Objective-C exception. Details below: 2021-08-30 11:43:15.181473 attempt to delete row 100 from section 0 which only contains 39 rows before the update
Remark the word delete even if I don't access the TableView for deleting !?
-
@ihf No new version today, perhaps first time 😂
Jus to show that I don't do nothing, busy to study external keyboard keys combinations
And I count on you to propose the choice of actions, even from top menu...I'll have to program each case but not a big effort (I hope) -
@cvp this looks like a good list of actions. Are show children and hide children the same as the existing menu items show all and collapse all?
-
@ihf said:
Are show children and hide children the same as the existing menu items show all and collapse all?
No, they are the same as in the popup menu of a tapped outline.
BuT they are not yet programmed, they are there are examples. please choose which actions you would want to see there, from any pressed button or menu option chosen. And then I could say if they are possible to be simulated. -
@cvp Show All and Collapse All would be useful keyboard shortcuts. I am using an external keyboard right now and will think about how often I use menu items that might be executed from the keyboard.
Wish list: searching across outlines.
-
@cvp Wish list (that probably is a non-starter): Ability to put an item (text snippet, URL, etc.) in an Outline via the Share sheet (perhaps done using a Shortcut). As I write this I realize that given Pythonista, one problem would be how long it would take to perform this action thus negating its value.
-
-