Beta Status Update
Unfortunately, I've recently been unable to provide a new beta version of Pythonista 1.6. This is partly my own fault, and partly due to unexpected difficulties with TestFlight.
First off, I've been working on two different branches of Pythonista for quite some time, one being the current (expired) 1.6 beta, a relatively minor update with new Python modules but not much else, the other a more significant update with a major UI refresh and quite a few other new features that I'm pretty excited about (more on that soon).
This approach has sometimes made it difficult to keep both versions in a working state. When I changed something in version B, I sometimes ended up accidentally breaking stuff in version A... So a couple of weeks ago, I decided to ditch the current beta branch, and exclusively focus on the new version instead, but I have to admit that I vastly underestimated the amount of work that this would take – a lot of basic things were still missing in the new branch, and even though it had some nice new features, it would have been a step down in terms of stability and basic functionality that you'd expect, even if you were coming from 1.5.
Right now, it's still a bit rough around the edges, but definitely usable and an improvement over the current version. Unfortunately, I haven't been able to get TestFlight to work with it yet. I continue running into server-side issues with builds not processing properly after I upload them. In order to make some new features work, I had to change the App ID (for code-signing), and it seems that this is a scenario that just doesn't work very well with TestFlight – it's difficult to go back now because that would mean sacrificing new functionality that I spent quite a lot of time on... At first, the only reason for the new App ID requirement was the document picker support in the new
dialogsmodule (requires iCloud entitlements), but the new version also contains an app extension (for running scripts from the share sheet in other apps), and I've realized now that this also doesn't work with the old App ID, and while the document picker support wasn't that important to me, the app extension is a major feature that I really want to ship.
If you do have the current (expired) beta installed and would like to get your data out of it, here are two options you can use:
Option 1 (if you have a Mac with Xcode):
- Connect your device via USB
- Start Xcode and select Devices from the Window menu, then select the connected device in the sidebar
- Under Installed Apps, select Pythonista
- Click on the "Gear" icon and select Download Container...
The downloaded container is a package (i.e. folder), so you can view the individual files in Finder by selecting Show Package Contents from the context menu.
Option 2 (if you're on a PC or don't want to install Xcode):
- Make an unencrypted(!) backup of your device using iTunes
- Download the iBackup Viewer tool (Mac or Windows) – (the free version will do, if you have the paid version, you could also encrypt your backup)
- Go to "(your device)/Applications" (this may take a while to load)
- Select Pythonista in the list of apps, then click the "gear" button and select Save all Files.... I would recommend that you create a new folder for this because the app will create multiple folders while extracting the backup files.
Edit: You can also try downgrading by downloading 1.5 from the App Store. Apparently, this didn't result in data loss for some people, but I'm not quite sure if this always works.
That's all I have for now. I'm very sorry this took so long. When I know more, I'll post it here.
Traceback (most recent call last): File "/var/mobile/Containers/Data/Application/9C6CA438-893C-4AD6-BB3C-62437E69416C/Documents/chordcalc/chordCalc/Spinner.py", line 188, in <module> spinner1.position = (110,150) File "/var/mobile/Containers/Data/Application/9C6CA438-893C-4AD6-BB3C-62437E69416C/Documents/chordcalc/chordCalc/Spinner.py", line 110, in position self.frame = value + tuple(self.frame[2:]) TypeError: sequence index must be integer, not 'slice'
ui.View.frameobject is now type Rect and not a list. Need to read the new ui docs.
There was a new version of
TestFlightreleased a few daze after the Beta. Perhaps that new TF release helped with the issue of installing of one beta on top of another.
@polymerchm, try converting to a tuple before slicing:
@ccc, if I were to guess TestFlight is only the front-end to the beta app system, similar to the App Store app. Both of those don't actually need to be running during the installation of apps, they are just necessary to start the installation. I'd imagine that TestFlight gets the app package from somewhere else, but installs it like any normal app, so I doubt the TestFlight update would have any direct effect on the installation process.
MIDIPlayercrash: I made a last-minute change there that I didn't test properly. Here's a quick workaround – just replace the last two lines with this:
import os soundbank_path = os.path.abspath(os.path.join(os.__file__, '../../merlin_silver.sf2')) player = sound.MIDIPlayer('output.mid', soundbank_path) player.play()
Here's another missing feature: changing the console font and size. Is it just me, or are the default fonts in the new beta larger than they used to be?
Found a bug in the
uimodule - an
boundsattribute is a
ui.Rect, but expects a tuple when setting. For example, this code will fail:
import ui sv = ui.ScrollView() sv.bounds = sv.bounds """ Traceback (most recent call last): File "<string>", line 3, in <module> TypeError: Expected a tuple """
@omz The workaround worked for me. Thanks.
On the new scenekit, I haven't been able to get gravity to work. I tried to modify the Physics Clock demo to add gravity from motion, but using self.physicsgravity = motion.getgravity()[:2] doesn't seem to work; in fact self.physics_gravity = (5,-5) or something similar does not work either. Numbers still fall straight down. Am I missing something?
Not sure why this doesn't work for you, here's a slightly modified PhysicsClock script that uses motion data for changing the gravity:
@omz - yes the workaround fixes the problem. It also shows how to select the soundfont! Thanks!
Not sure if a new thread is in order... But here are a few observations about the new beta...
- in general ... Wow! Looking amazing.
- console: I thought in the old pythonista, there was a way to quickly clear the current input line. For instance, when you press the up arrow for history, pressing down repeatedly should bring you back to an empty line. This sometimes works in the beta, but only if you had previously typed an empty line!
- console history: I admit I liked the history that popped up partial completions. Arrows are nice too, but there were times when a histiry popup was nice.
- console: raw_input should give some indication that console is in input mode? I can't remember what 1.5 did, but I thought something changed.
- thank you for sound.Player.finished_handler! Should the MIDIPlayer have something similar?
- ui.Point, and ui.Size, etc are nice... however it seems like they should be tuple-like since some functions require tuples. For backwards compatibility, seems like slicing would need to be implemented. Then again, I guess adding tuples and adding vectors are very different operations, so maybe forcing people to cast as tuples if they want to slice is a reasonable compromise.
- several ui functions or properties, like ui.convert_point, content_offset, frame, bounds expect a tuple, yet return Point or Rects.
- bug: globals are cleared on run from editor, even if that setting is off. Running from action menu doesn't clear globals. This was breaking stash, and other Views run in panels, when suddenly imported modules were no longer in globals.
- I like the traceback browser, and it's ability to open files, however it seems like some errors are caught by the traceback without giving any indication to the user that there was an error. In 1.5 I think the editor or console would swipe into view when errors occurred. That could sometimes be annoying, and in certain cases made it hard to debug/stop a View... but we do need some indication of an error when in Views. Perhaps popover the traceback thingie onto the current view?
- getkbframe and convert point now work in fullscreen.
- still a problem - cannot use custom touch methods in a View presented as a panel, because the panel wants to slide to editor, and steals the touch events. Perhaps disable this feature when a View has touch handlers, and only slide using the top bar area?
- i like the ability to have more than one tabbed ui.View/Doc/webbrowser... but without View.close(), things get cluttered quickly. Is there a way to programatically define whether a View gets its own tab, or reuses an existing slot? Or a way to close tabs programatically? For instance, I'm thinking if two views have the same title, presenting the second view should not create a new tab. That way, generic untitled views always go to the same spot, while utilities can stay open.
- I understand editor actions.... But what are file actions, and how do I use them? Maybe I'm missing where the file action menu lives?
- is there a pythonista version number accessible via sysconfig or somewhere else? That could be useful for writing backwards compatible code, though I realize we can try importing some of the new modules.
Also.. Does the platform game example work for anyone? I'm on ipad2, and I just get a gray screen.
@JonB I wanted to report that as well. Gray screen, but the sound plays.
iPad mini 2, iOS 8.1.
Example "Random MIDI Melody.py" will close Pythonista immediate after start. Anyone seeing this behaviour as well? (iPad Air 2).
Edit: There is even no output.mid file created
bottle(still not current with pypi) and
bs4and then halts on
cffibecause that module is no longer included in Pythonista.
@JonB #Moe I get the grey screen as well on the platformer example. iPad Air.
I also added:
modules += '''appex cb ctypes dialogs sk'''.split() # modules added in Pythonista v1.6 Beta
pythonista_undocumented.pybut I also opened a new issue because I now realize that pythonista_undocumented is doing an incomplete job by overlooking class methods. Any pull requests to close that issue would be gratefully accepted.
@omz excellent changes, this is a major release thanks, please if it's possible add:
- line numbers on iPhone 6/6+
- Ability to set or get from the clipboard any object, not only text and images.
It would be really helpful!!!