Merge pull request #227 from gfyoung/template-main-clean

Clean up main.m and toolchain.py
This commit is contained in:
Richard Larkin 2016-11-21 02:11:57 +02:00 committed by GitHub
commit 2ee01cf9e7
2 changed files with 6 additions and 8 deletions

View file

@ -1145,7 +1145,7 @@ Xcode:
def distclean(self): def distclean(self):
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Clean the build, download and dist") description="Clean the build, download, and dist")
args = parser.parse_args(sys.argv[2:]) args = parser.parse_args(sys.argv[2:])
ctx = Context() ctx = Context()
if exists(ctx.build_dir): if exists(ctx.build_dir):
@ -1175,7 +1175,7 @@ Xcode:
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Create a new xcode project") description="Create a new xcode project")
parser.add_argument("name", help="Name of your project") parser.add_argument("name", help="Name of your project")
parser.add_argument("directory", help="Directory where your project live") parser.add_argument("directory", help="Directory where your project lives")
args = parser.parse_args(sys.argv[2:]) args = parser.parse_args(sys.argv[2:])
from cookiecutter.main import cookiecutter from cookiecutter.main import cookiecutter

View file

@ -5,8 +5,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
//#include <python2.7/Python.h>
//#include <Python.h>
#include "../dist/root/python/include/python2.7/Python.h" #include "../dist/root/python/include/python2.7/Python.h"
#include "../dist/include/common/sdl2/SDL_main.h" #include "../dist/include/common/sdl2/SDL_main.h"
#include <dlfcn.h> #include <dlfcn.h>
@ -23,14 +21,14 @@ int main(int argc, char *argv[]) {
chdir("YourApp"); chdir("YourApp");
// Special environment to prefer .pyo, and don't write bytecode if .py are found // Special environment to prefer .pyo, and don't write bytecode if .py are found
// because the process will not have write attribute on the device. // because the process will not have a write attribute on the device.
putenv("PYTHONOPTIMIZE=2"); putenv("PYTHONOPTIMIZE=2");
putenv("PYTHONDONTWRITEBYTECODE=1"); putenv("PYTHONDONTWRITEBYTECODE=1");
putenv("PYTHONNOUSERSITE=1"); putenv("PYTHONNOUSERSITE=1");
putenv("PYTHONPATH=."); putenv("PYTHONPATH=.");
//putenv("PYTHONVERBOSE=1"); //putenv("PYTHONVERBOSE=1");
// Kivy environment to prefer some implementation on ios platform // Kivy environment to prefer some implementation on iOS platform
putenv("KIVY_BUILD=ios"); putenv("KIVY_BUILD=ios");
putenv("KIVY_NO_CONFIG=1"); putenv("KIVY_NO_CONFIG=1");
putenv("KIVY_NO_FILELOG=1"); putenv("KIVY_NO_FILELOG=1");
@ -52,7 +50,7 @@ int main(int argc, char *argv[]) {
Py_Initialize(); Py_Initialize();
PySys_SetArgv(argc, argv); PySys_SetArgv(argc, argv);
// If other modules are using thread, we need to initialize them before. // If other modules are using the thread, we need to initialize them before.
PyEval_InitThreads(); PyEval_InitThreads();
// Add an importer for builtin modules // Add an importer for builtin modules
@ -78,7 +76,7 @@ int main(int argc, char *argv[]) {
[pool release]; [pool release];
// Look like the app still runn even when we leaved here. // Look like the app still runs even when we left here.
exit(ret); exit(ret);
return ret; return ret;
} }