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
-
@ihf said:
it scrolls one of the items near the bottom of the outline rather than the outline.
No comprendo
-
@ihf When you have installed V00.49, did you restart Pythonista because, if we change keyboard_frame_did_change code (what V00.49 does), Pythonista has to be reloaded.
-
-
@cvp, impressive! Know how hard these seemingly simple things can be.
-
@mikael said:
Know how hard these seemingly simple things can be.
Don't forget that I'm not a pro, it took hours of sweat for me, perhaps done in a few minutes by an expert. The problem was this mixed of TextView in a TableView...
-
@ihf Please give me some (good 😀) news about your problems of scrolling with keyboard because, for me, I don't see any issue since V00.49, and also the added button for dismissing keyboard on iPhone.
-
@ihf said:
I save an outline to iCloud on iPad and then go to IPhone but do not see the outline I just saved. Is it now necessary for me to go back to Files to download it? That may be outside your control but it is very inconvenient to always remember to do that if you are going from one device to the other.
Perhaps you have seen this topic, written after my search and tests to solve your issue.
Will be integrated in a future versionAnother problem is that if you try to select via Pythonista, you don't see the unloaded iCloud files.
You would need to select via the Files app like dialogs.pick_document does but this one does not
show The Pythonista local files...
Incoherence
If you want an unique way- either no Pythonista local files (dialogs.pick_document)
- either no unloaded iCloud files (my files_picker)
Try this script, it downloads a selected file if not downloaded.
import dialogs #import shutil fil = dialogs.pick_document(types=['public.item']) print(fil) #shutil.copy(fil,'test')
I think personally that the best solution for you would be to use files_picker for local files and dialogs.pick_document for other Files app files, then two different ways but you would not need anymore to care about downloaded or not.
-
@cvp With regard to the scrolling, I just tested on the iPad and it works except that if I am looking at the outline which takes up more than 1/2 the screen and I select a line which is below the midpoint,, the keyboard will appear (as it should) and obscure the line I selected. I can then scroll the outline up to see it but it would be better, if possible, if the view scrolled in such a way that the selected line was visible when the keyboard appears.
However, when I went to the iPhone and selected open I got this error:
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 1427, in tableview_did_select self.files_action(None, act) # no need to pass waited sender File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 1552, in files_action f = File_Picker.file_picker_dialog('Pick a text file', root_dir=self.path_to_name) File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/File_Picker.py", line 378, in file_picker_dialog picker = TreeDialogController(root_node, allow_multi=multiple) File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/File_Picker.py", line 184, in __init__ self.expand_root() File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/File_Picker.py", line 187, in expand_root self.root_node.expand_children() File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/File_Picker.py", line 113, in expand_children node = FileTreeNode(full_path, self.show_size, self.select_dirs, self.file_pattern,self.only) File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/File_Picker.py", line 79, in __init__ self.subtitle = human_size((os.stat(self.path).st_size)) PermissionError: [Errno 1] Operation not permitted: '/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/'
-
@ihf said:
when I went to the iPhone and selected open I got this error:
I don't know why but, on iPhone, iCloud Drive not seen as a folder but as a file...by Pythonista file system operations os.path.isdir
Edit: see two posts below in V00.52 explanation
-
@ihf New V00.51 available with
Version V00.51 - protection against crash on iPhone when open a file. On iPhone, iCloud Drive folder is not seen as a folder by os.path.isdir(). => Support only Pythonista local and iCloud files
I know that it could be annoying if you want to store files in "on my iPhone" or "iCloud Drive" and access them on your iPhone, but I can't do anything actually.
And this does not yet solve the problem of files created on iPad in Pythonista iCloud and not visible in iPhone. I shall solve that with dialogs.pick_document but later.
-
@ihf New V00.52 available with
Version V00.52 - protection against crash when open a file. Offer only "on my iDevice" and "iCloud Drive" if their path exists, that will say "open once as external folder"
When I posted V00.51, as temporary protection, I didn't remember (and neither do you 🙄) that to allow access to iCloud Drive you have to open it once as external folder on your iPhone.
Now, the V00.52 will not crash but first will check if the folder is accessible before trying to offer it for open. -
@ihf said:
With regard to the scrolling, I just tested on the iPad and it works except that if I am looking at the outline which takes up more than 1/2 the screen and I select a line which is below the midpoint,, the keyboard will appear (as it should) and obscure the line I selected. I can then scroll the outline up to see it but it would be better, if possible, if the view scrolled in such a way that the selected line was visible when the keyboard appears.
New V00.53 available with
Version V00.53 - when editing a row that would be hidden by the appearing keyboard, automatically scrolls so the row is above the keyboard
Please tell me if you're happy with this update, it is important for me ❗️
Also, tell me if you are happy with the modification of V00.50 relative to reaching the right side of your window, it is also important for me ❗️
-
@ihf said:
I save an outline to iCloud on iPad and then go to IPhone but do not see the outline I just saved. Is it now necessary for me to go back to Files to download it? That may be outside your control but it is very inconvenient to always remember to do that if you are going from one device to the other.
I'll solve it, promised, in one future version. You would no more need to go through the Files app first,
but not so urgent, isn'it?There are several ways to pick a file or select a folder.
File_Picker module is ok for local Pythonista files but, for external folders like iCloud Drive or 'on my iDevice', needs these folders to be open as external folders.
Also, for Pythonista iCloud, only downloaded files are shown (your problem).
The dialogs.pick_document is ok for Files app folders but does not allow to select a folder (needed by 'new file' option).
This function is based on ObjectiveC UIDocumentPickerViewController.
I'll use my own UIDocumentPickerViewController for Files app files but also to select a folder. Unfortunately, it does not allow access to Pythonista files, thus I'll need to first ask the user (you) if he wants to access Pythonista local files or all other ones. Sorry to be so long in my explanation, but this was needed, I think, for a better understanding. -
@cvp with respect to the change in version 53 to make the edited row visible above the keyboard, I just started testing and it works except if I go to the last line of the outline, the keyboard moves as it should, but if I hit return a new Outline item is created that is hidden by the keyboard. Ideally the editing point would always be visible. I will do some more testing of this and the other changes.
-
@ihf said:
except if I go to the last line of the outline, the keyboard moves as it should, but if I hit return a new Outline item is created that is hidden by the keyboard
Not true for me, new line is just above the keyboard
-
@cvp I will go back and test that again more thoroughly. I just saved the outline on the iPad then went to the iPhone, to the Files app, download it the newly saved outline. When I went to open it, I got the following:
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 2077, in tableview_cell_for_row if row == self.cursor[0]: AttributeError: 'Outliner' object has no attribute 'cursor' Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 2077, in tableview_cell_for_row if row == self.cursor[0]: AttributeError: 'Outliner' object has no attribute 'cursor' Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 2077, in tableview_cell_for_row if row == self.cursor[0]: AttributeError: 'Outliner' object has no attribute 'cursor' Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/6CCAAFF1-947E-4DC8-B33B-58EE87A0823C/Pythonista3/Documents/outline.py", line 2077, in tableview_cell_for_row if row == self.cursor[0]: AttributeError: 'Outliner' object has no attribute 'cursor'
-
@ihf said:
When I went to open it, I got the following:
Sorry for that, never meT this problem.
Did you- open the file by files/open
- open automatically as last open
- open by shortcut argument?
-
@cvp I went back to the iPad and confirmed that if I select the last line for text insertion, hit return to add an item, that new item is hidden by the keyboard. If you then scroll up to see that line and bring up the floating menu, the keyboard is hidden and the floating menu appears but points to the middle of the outline.
-
@ihf sorry, what is the floating menu? The popup menu?
-
@ihf said:
floating menu appears but points to the middle of the outline.
I'll become crazy 😂, or perhaps is it already so.