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.
Preventing app from being changed
-
I have my Phythonista app now. It is a simple app that allows a user to enter a ticket #, a brief message, and take up to four pictures. Once they click "SEND," it is all E-Mailed to an address. This is for a loading dock, so they can take pics of damaged loads.
So a couple of questions: (1) can I prevent users from accidentally changing the app? I don't care if they can see the source, just don't want them accidentally making changes to the point where it doesn't work.
(2) I've backed-up my .py file via E-Mail, is there a way to backup the .pyui file as well?
(3) I added an icon to the home screen but noticed that if I hit the Home button and tap the icon a dozen times, then go into Pythonista, I have a dozen instances of the app running. I can keep pressing X in the upper left-hand corner. Any way to prevent this?
Sorry for all the newbie question. I downloaded the Pythonista app on Friday and had my application running this evening. Very nice development system.
-
-
I suppose you could "zip" the source code (both the py and pyui, the later is just text). Then write a run script that unzips them and executes the source.
-
the Pyui files are text files. Just not readily readable. I suggest using a git repository and the StaSH shell.
-
???
-
-
That is good, it is brilliant, thank you!
-
You can use os.chmod to set the script to read only. This allows it to run, but cannot be edited wiout first un-chmod'ing it.
os.chmod(filename,0o100444)
will make it readonly.
os.chmod(filename,0o100777)
will let you edit it again.
Gist is a convienent way to backup a small amount of files, since it is built in. Pro-tip, if you click edit in the file browser, then select a few files, then the share button at the bottom, you can share multiple files to a single gist.
-
for #3, generally the url scheme will not work if a script is running. so, if you add a wait_modal to the end of your script, the script will stay running until the user cancels or dismisses.
You could also catch KeyboardInterrupt and then close the view, to prevent multiple copies if the user cancels.