"Unsupported File Type"
This is probably a feature request (although I'd be interested if anyone has a work-around via script.) Also, I'm new to iOS so please forgive me if I don't get the terminology correct.
When I tap a file that Pythonista isn't familiar with I receive a message that reads:
Unsupported File Type
This file cannot be opened with Pythonista.
Can we please instead have a screen that looks like this:
so that we can let other apps that have set up handlers open the files in question.
I use python scripts to update and retrieve information as part of my daily workflow. For example - I retrieved a database and a pdf from a client through Python. If I tap the pdf in file view Pythonista's built-in viewer opens it. It's a nice feature but more importantly it allows me (through the sharing widget) to share/export the file with other apps ('Open in:' iBooks, Kindle, Chrome, etc..) When I tap the database all I get is a prompt that reads 'Unsupported File Type' even if I have an app that has registered the file type and can open it.
Can you do it? Pretty please?
@JonB, This sounds supercool... Would you be willing to create a repo of code?
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 ).
Here's a little tool to browse files and use 'Open in' on any of them....
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