Looks like this still hasn't been addressed. The "On My iPad/Pythonista 3" folder appears to be completely disconnected from the app. This needs to be fixed for Git via Working Copy to be viable.
Any updates from the developer on this bug?
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.
Looks like this still hasn't been addressed. The "On My iPad/Pythonista 3" folder appears to be completely disconnected from the app. This needs to be fixed for Git via Working Copy to be viable.
Any updates from the developer on this bug?
I see, so there's no way to have the Today widget trigger a background task without the memory limit?
I guess the limit makes sense, if you had lots of Today widgets that used a bunch of memory you could have all sorts of problems.
I would be interested in getting in on the beta as well. I do use Pythonista pretty extensively. ;)
Wondering if there's any plan to include a Today widget. I've seen it mentioned before but most people overlook one of the main advantages.
With a Today widget, it would (theoretically) be possible to run a script without needing to open the app at all, and even without unlocking the device. Currently, there are several ways to run scripts via URLs, Workflow, etc. but they all require you to switch to the app and unlock the device if it's locked. With a Today widget, I could pull down, trigger a background script, get a notification (or a status indicator in the Today widget) when it had finished, and be on my way much faster. I have several plans for scripts that I really want to be able to trigger from the lock screen, and this would allow me to do that.
I think this is similar to a problem I have with Pythonista. It's probably common code between both apps.
I'm not sure if I'm just missing something, but I can't find a built-in choose from list function. There's an Editorial workflow action for this, but I'd like to be able to use it in a Pythonista script. I would assume it would be in the console
library.
I could always build a completely custom UI, but this is something that would be great to have built-in.
From another answer to another question, it looks like it has just that. Dang it, now I really want the beta. :)
I mostly agree with @roosterboy - the preferred version for Pythonista should be what's included in the latest version of OS X. On the other hand, Python 3 is going to become more popular as time goes on, and eventually when we switch, a lot of things are going to break.
@omz, you mentioned you can't include two versions - is this an Apple limitation?
Here's what I'd like to see in the ideal case. First of all, Python 3 support should be a major paid release. That's a lot of work and you deserve the support. ;) I'd also be perfectly happy waiting for P3 support until Apple makes it the default. When you do, assuming it's possible to have both versions, include P3 and make it the default interpreter, but allow files to have a special comment that, included as the first line of the script, will make it use Python 2.x. You could even add that line to each file as part of the upgrade process, then warn users that new Python 3.x scripts won't be compatible with the old ones.
Most importantly, don't worry about moving along too quickly. I'd rather have an older, stable Pythonista than an unstable version with the newest language features. ;)
Okay, I've figured it out, for now at least. And it doesn't need the clipboard! First, download this Editorial workflow. The workflow sends the content to the forum page; make sure you're logged into the forums in Safari. Now, you need the JavaScript bookmarklet. Create any bookmark and then edit it. Copy and paste the following code into the bookmark's URL field:
javascript:var urls = window.location.href.split('?'); if (urls.length > 1) { var params = urls[1].split('&'); for (x=0; x<params.length; x++) {var p = params[x].split('='); if (p.length == 2) {if (p[0] == 'omztitle') {var title=decodeURIComponent(p[1]); var titlebox=document.getElementsByName('title')[0]; titlebox.value=title;} else if (p[0] == 'omzcontent') {var content=decodeURIComponent(p[1]); var contentbox = document.getElementById('wmd-input'); contentbox.value=content}}}}
(Make sure to get the entire line - it's a long one.) You can also drag <a href="javascript:var urls = window.location.href.split('?'); if (urls.length > 1) { var params = urls[1].split('&'); for (x=0; x<params.length; x++) {var p = params[x].split('='); if (p.length == 2) {if (p[0] == 'omztitle') {var title=decodeURIComponent(p[1]); var titlebox=document.getElementsByName('title')[0]; titlebox.value=title;} else if (p[0] == 'omzcontent') {var content=decodeURIComponent(p[1]); var contentbox = document.getElementById('wmd-input'); contentbox.value=content}}}}">THIS LINK</a> to your Bookmarks from the desktop version of Safari and sync it over - it's easier.
Then, to post, just name your file with the desired title and type out your post. Trigger the workflow and wait for the page to load. Then, run the bookmark and you should see your content filled out.
If we can get that JavaScript added to the forum website, the workflow will work without the bookmarklet. ;)
The problem with using JavaScript is that using Safari you can't control anything after the URL is passed to it. It would be possible to use a Safari extension to directly access the DOM, but it would require a separate app, and the Workflow app can only do Action extensions.
You could also open it in the app's built-in browser, but you'd have to authenticate separately. I prefer to keep authentications within Safari whenever possible.
I agree, this would be a really nice thing to have. There are two ways I came up with that might work.
First, there's the easy way, which is launching the forums in Safari. You could ideally just encode the title/text into the URL, and you could even have a popup to choose the option in the General/Share Code/Questions menu. The problem is that the forum page doesn't support this. I'm not sure what software is used, or if it's custom. Some forms allow you to do this, though. In fact, you can already choose the popup option here. Try for example https://omz-forums.appspot.com/pythonista/new?category=Questions and you'll see that option already is selected. I tried to replicate it but I'm not sure which conditions dictate when this can and can't be done. The benefit to this option would be that you'd be using the official site and you'd be authenticated in Safari. (Bonus points for passing those parameters through the login page if you're not already logged in)
The second way is basically to build a custom client. This would be the most seamless way to do it, and it could post without ever leaving Pythonista or Editorial. The disadvantage is that you'd be posting blind, i.e. you wouldn't be able to see the website's preview and you'd have to ensure your Markdown was perfect before posting. That's a good reason to do the website redirect. If there was an official API for the forum it would be easier. But it might also open things up to spam if you had the ability to easily automate posts like that.
A third way would be copying the text to the clipboard and just opening the new post URL - it does require pasting it in but it's almost as good as the other options.
Maybe we could get the URL parameter parsing added to the post pages so we could send the title and contents.
When using console.input_alert(), the keyboard isn't properly activated.
This can be seen in two ways. First, when using an external keyboard, triggering an input_alert and then typing actually continues entering text into the editor instead of the alert. Second, with the onscreen keyboard, the keyboard remains in the background and inactive. Tapping in the text field activates it in both instances, but it's an extra unnecessary step.
While developing some new scripts, I started dividing functionality into separate files. An example of this is a FeedWrangler class that I'm going to use in a few different things.
I have two files: the FeedWrangler.py file with the FeedWrangler class, and a driver program that instantiates the class and does various things. I'll make a change in FeedWrangler.py and then go back and run the driver program.
The problem is that sometimes, I'll make a change in FeedWrangler.py, run the driver, and the output remains unchanged. It appears that there may be some sort of caching or JIT compiling going on that results in the new code not being used. Obviously, this is a problem, and it makes development a little frustrating.
Here's an example, Test1.py:
class Test1:
def say(self):
print "Hello World 1"
Now for the driver:
import Test1
def main():
t1 = Test1.Test1()
t1.say()
if __name__=="__main__":
main()
If you run the driver, you'll see "Hello World 1" printed. If you change that to 2, go back and run the driver again, you'll still see it print 1.
I did send an email to get into the beta but haven't heard back yet (it was only a few minutes ago) so I can't test to see if it happens on that version.
I did another test. In Test1.py, I imported and ran the driver program. Essentially this sets up a loop where Test1 imports Test2, which runs Test1. Surprisingly this works, but it still suffers from the cache problem - in reverse. If I import the driver and run the whole thing from the Test1 class, any changes to the driver aren't reflected, but changes to Test1 are. If the driver is the one started by Pythonista, changes to the driver are reflected but not changes to Test1.
So I have a complex script that takes a web page and turns it into a .epub file. Unfortunately, I can't figure out how to move the .epub file to iBooks.
First, I figured Pythonista would have the ability to present an Open In popover using one of its custom modules. That's not the case. (Feature request!) ;)
So barring that option, I tried opening the file in the browser. Unfortunately, I get the following error:
Error
An error occurred while loading the page: Frame load interrupted
Normally, if a .epub file is opened in Safari, it presents the option to open it in iBooks or another app. This is the functionality I want. Ideally, Pythonista could present the Open In popover, but until that happens, is there a way to open files like this?
The code I'm using is:
fullpath = os.path.join(os.getcwd(),"test.epub")
webbrowser.open("file://"+fullpath)
Does anyone know how to do this?
iBooks' URL scheme accepts iTunes store links, but I'm trying to pass in my own generated ePub. Different job.
Also, you can't just open a link to a file in an external web browser. Launching Safari isn't going to help at all.
@omz Nope, doesn't work. It works for some files, not others.
I'd like to see something like console.open_in()
that triggers the document interaction controller for opening the specified file path in other apps. It would make this task a lot easier.
You could also name it console.open_uidocumentinteractioncontroller()
but that seems unnecessarily wordy. :D
Also, since this thread is more about the 1.4 update, maybe use this thread for discussion on this particular problem.
Ha. In my thread 58 minutes ago I asked about the Open In menu. DEUS EX APPSTORE. :D
EDIT: Nope.
So I thought this was the answer. What I need to do is take a file IN Pythonista and Open In... another application. Files being visible in the sidebar is a nice step, but it needs the ability to take those files and Open In other apps that support them. Right now I have content in Pythonista that I can't get where it needs to go.