pythonpath.r 2.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
** Resources for the sys.path initialization, the Python options
** and the preference filename
*/
#include "Types.r"
#include "patchlevel.h"
#include "pythonresources.h"

/* A few resource type declarations */

type 'Popt' {
	literal byte version = POPT_VERSION_CURRENT;
	byte noInspect = 0, inspect = 1;
	byte noVerbose = 0, verbose = 1;
	byte noOptimize = 0, optimize = 1;
	byte noUnbuffered = 0, unbuffered = 1;
	byte noDebugParser = 0, debugParser = 1;
18 19 20 21 22
	byte unused_0 = 0, unused_1 = 1;
	byte closeAlways = POPT_KEEPCONSOLE_NEVER,
	     noCloseOutput = POPT_KEEPCONSOLE_OUTPUT,
	     noCloseError = POPT_KEEPCONSOLE_ERROR,
	     closeNever = POPT_KEEPCONSOLE_ALWAYS;
23 24 25 26
	byte interactiveOptions = 0, noInteractiveOptions = 1;
	byte argcArgv = 0, noArgcArgv = 1;
	byte newStandardExceptions = 0, oldStandardExceptions = 1;
	byte sitePython = 0, noSitePython = 1;
27
	byte navService = 0, noNavService = 1;
28
	byte noDelayConsole = 0, delayConsole = 1;
29 30
	byte noDivisionWarning = 0, divisionWarning = 1;
	byte noUnixNewlines = 0, unixNewlines = 1;
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
};

type 'TMPL' {
	wide array {
		pstring;
		literal longint;
	};
};

/* The resources themselves */

/* Popt template, for editing them in ResEdit */

resource 'TMPL' (PYTHONOPTIONS_ID, "Popt") {
	{
		"preference version",			'DBYT',
		"Interactive after script",		'DBYT',
		"Verbose import",				'DBYT',
		"Optimize",						'DBYT',
		"Unbuffered stdio",				'DBYT',
		"Debug parser",					'DBYT',
		"Keep window on normal exit",	'DBYT',
		"Keep window on error exit",	'DBYT',
		"No interactive option dialog",	'DBYT',
		"No argc/argv emulation",		'DBYT',
		"Old standard exceptions",		'DBYT',
		"No site-python support",		'DBYT',
58
		"No NavServices in macfs",		'DBYT',
59
		"Delay console window",			'DBYT',
60 61
		"Warnings for old-style division",	'DBYT',
		"Allow unix newlines on textfile input",'DBYT',
62 63 64 65 66 67 68 69 70 71 72 73
	}
};

/* The default-default Python options */

resource 'Popt' (PYTHONOPTIONS_ID, "Options") {
	POPT_VERSION_CURRENT,
	noInspect,
	noVerbose,
	noOptimize,
	noUnbuffered,
	noDebugParser,
74 75
	unused_0,
	noCloseOutput,
76 77 78 79
	interactiveOptions,
	argcArgv,
	newStandardExceptions,
	sitePython,
80
	navService,
81
	noDelayConsole,
82 83
	noDivisionWarning,
	unixNewlines,
84 85 86 87 88 89 90
};

/* The sys.path initializer */

resource 'STR#' (PYTHONPATH_ID, "sys.path initialization") {
	{
		"$(PYTHON)",
Jack Jansen's avatar
Jack Jansen committed
91
		"$(PYTHON):Lib",
92
		"$(PYTHON):Lib:lib-dynload",
93 94
		"$(PYTHON):Lib:plat-mac",
		"$(PYTHON):Lib:plat-mac:lib-scriptpackages",
95
		"$(PYTHON):Mac:Lib",
96
		"$(PYTHON):Extensions:img:Mac",
97
		"$(PYTHON):Extensions:img:Lib",
98
		"$(PYTHON):Extensions:Imaging",
Jack Jansen's avatar
Jack Jansen committed
99 100
		"$(PYTHON):Lib:lib-tk",
		"$(PYTHON):Lib:site-packages",
101 102 103 104 105 106 107 108
	}
};

/* The preferences filename */

resource 'STR ' (PREFFILENAME_ID, PREFFILENAME_PASCAL_NAME) {
	$$Format("Python %s Preferences", PY_VERSION)
};