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.
"Unsupported File Type"
-
I'd actually like to add a request to allow opening of text files that have extensions that are common for text files, like "ini" or "cfg". For example, when I use ConfigParser to save configuration or settings, I typically save it as an *.ini file, which then becomes uneditable.
Thanks to briarfox for a workaround.
-
I've been experimenting with using a javascript based editor, hosted in a
ui.WebView
, to open any type of file.For instance the ace editor is very full featured, I'm sure there are others. It supports hilihting, etc for hundreds of different languages. Presenting in a
panel
makes this very natural to swap back and forth between console.WebView
can open file:// type urls, if os.path.abspath is used. Using a webview delegate would allow custom callbacks, if needed, though one could also create the ui elements in pythonista, which call editor functions througheval_js
. -
@JonB, This sounds supercool... Would you be willing to create a repo of code?
-
I'm doing something using a javascript based editor, hosted in a ui.WebView, too. I've got it resizing nicely on orientation change and on keyboard activation / deactivation.
-
Here is what I came up with.
This uses editarea. I started with ace, but that seems to have keyboard issues on mobile.
I also tried codemirror... I really like some of the modes. There's a fork with ios support, but it is flaky, again keyboard/selecting.Then, I used editarea for a while, but it had an annoying ghosting issue. Later figured out opacity of hidden in css was too high, setting it lower mostly works. Sometimes keyboard doesn't work until you change focus, or min keyboard.
It does have tabbed multifile support, which I have turned off... Need to implement js to python callbacks through custom urls. Eventually a shellista plugin.I'd love to see how you handled orientation changes, etc!
-
I'm using CKEditor as I want wysiwyg editing of html.
For orientation it's easiest to addEventListener for orientationchange in the html.
There's no simple equivalent for the keyboard show/hide in the html ( though you could load a java package like http://github.com/driftyco/ionic-plugins-keyboard/tree/60b803617af49a10aff831099db90340e5bb654c ).
The simplest for that is to use a custom view and evaluate javascript in the keyboard frame will change.
-
Here's a little tool to browse files and use 'Open in' on any of them....
http://omz-forums.appspot.com/pythonista/post/6151216794959872
-
The shellista dev-modular branch now includes nano. It will open any file as text to allow editing.
-
@JonB I've now got all the resizing into the python script evaluating java. Here are the 5 events I'm handling and where:
1 initial size: set in webview_did_finish_load 2 orientation change (keyboard hidden): handled in View layout 3 orientation change (keyboard shown): handled in View keyboard_frame_will_change 4 keyboard shown: handled in View keyboard_frame_will_change 5 keyboard hidden: handled in View keyboard_frame_will_change
-
Do you have a repo someplace?
-
@JonB Here's the code... you'd have to adjust the View layout section if you have anything other than orientation changes triggering the layout.
# see code for EditView class
Edit: JonB... note it gives -90 not 270