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 Glad to see you are maintaining your sense of humor :-)
-
@ihf said:
Question: what are the .old files that are being created (and which I delete)?
Each time that the program saves a couple of files (txt and content), the program
- deletes the old files
- Rename actual files into .old
- Saves files
This is a protection against a crash during saving, which could generate a loss of the files.
Thus, you don't need to delete them your-self.
If you prefer, I can comment this process (I have tested their duration: some hundredths of second).
-
This post is deleted! -
@ihf The outline file is showed in an ui.TableView which normally is used to display a set of rows without editing their content, delete excepted. No editing, thus no keyboard.
Manual scroll shows as maximum the last row at the bottom of the screen, not in the middle of the screen because no keyboard would be displayed.
In our case, in each displayed row, the script creates an ui.TextView to allow edition of texts.
Then, the keyboard appears.
I'll try to allow manual scroll so the last row would be just above the keyboard, but nothing promised.I'll try by setting the bottom contentinset of the TableView a value equal to the height of the keyboard
-
@ihf New V00.49 available with
Version V00.49 - correction of bug "scrolling not allowed when keyboard hides row to be edited" by setting tableview content inset bottom = keyboard height
Please try if the problem of "unallowed scroll when keyboard appears and hides outlines you want to edit" is solved
And tell me... -
@cvp First test: iPhone, Portrait mode with outline that fills a little over 1/2 of the screen. If insertion point is at end of 1st item, cannot scroll outline. Hide keyboard, outline visible. Touch 2nd to last item, cannot scroll though swiping (not scrolling) works sometimes. Also, sometimes when I swipe the outline up it scrolls one of the items near the bottom of the outline rather than the outline.
I’ll try more tests with iPhone and iPad. -
@ihf said:
cannot scroll though swiping (not scrolling) works sometimes.
What's the difference between scroll and swipe?
Swipe vertically a scrollview scrolls it.Sorry, but I don't understand what you want to do and what doesn't work.
-
@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.