When will OMZ release an Xcode Template for Python3?
Is it in the works? As soon as its available I'll be able to move forward on a lot of projects.
there was a long thread about this topic. The issue is that the
filecommand says .py files are executable, and thus need to be signed. The import pythonista was to trick file into thinking it is objc source code. It should be possuble to create a custom .mgc file that file uses to determine file types, and maybe trigger on the shebang line, etc, that makes it say it is a plain text file.
others created a script to go through every file in the template and add the import statement.
@omz is there any chance we'll get a today widget for this App Template? Maybe have two separate scripts,
main.pyfor the main app and
today_widget.pyfor the today widget?
@JonB Where would you put the import statements? When I say #import "pythonista" it says that 'pythonista' file not found
@RomSpy Did you figure out how to get your app uploaded?
Sorry, i should have linked to the long thread:
Near the middle, someone posted a script that automatically inserted
#\input texinfoat the start of every file, but it required sometimes hundreds of these. Later omz said that tou could replace that with
#import pythonista, which fools the
filecommand. you could probably modify the script to use that instead.
This post is deleted!last edited by
So for example, this file is the PYAAppDelegate.h and I put '#import pythonista' at the top as seen in the code excerpt below.
// Created by Ole Zorn on 25.08.18.
// Copyright © 2018 Ole Zorn. All rights reserved.
@interface PYAAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
This results in an error that states "Expected "FILENAME" or <FILENAME>"
What do I do to get rid of this error?
No no no. You only add this to the python files (.py), not .h or .c or .m, etc.
@JonB ok so now the only problem I'm having is the error saying :
"App Store Connect Operation Error
ERROR ITMS-90035: "Invalid Signature. Code object is not signed at all. The file at path [Pythonista3AppTemplate.app/Frameworks/Py3Kit.framework/pykit_preflight.py] is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html""
I think that's the last roadblock. Thanks so much for your help so far!
@JonB hmmmm, now when I try to upload it again all it says is "app store connect operation error: an error occurred uploading to the app store"
Did you add that line to the pykit_preflight.py?
@JonB what is pykit_preflight.py? I don't have that file
Did you read the error message?
@JonB Nevermind, I found it after showing the package contents of the py3kit framework!
But now I while i'm uploading, it stopped after a full bar stating "Completed App Store Operation" and it seems like it should be done, but it's not finishing the upload.
@JonB it just ended and still resulted in the error - App Store connect operation error: An error occurred uploading to the App Store.
What else should I do for it to work?
@JonB Is there a difference between:
- #import pythonista
- #import 'pythonista'
Try searching stackoverflow for your error message
@omz I successfully update my app in the App Store using the new template. I did have to add more #import 'pythonista' lines to get it to work.
One question I have is it deletes the database I am using when it does the update do you know if there is a way to prevent this? The database is created in the script folder by Pythonista when it first runs the app unless the database already exists. I have not had this problem with any other updates to the app that I have done.
@vignesh Are you archiving your app before uploading? If that is not working export your .ipa file and use the application loader instead that usually solves the problem you are describing.
@RomSpy which files did you have to add the #import 'pythonista' line on? Even on application loader I am still getting the same error