Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d2d2b20

Browse files
committed
Pythonpath converted to Rez source, and vers resource removed from
bundle to its own Rez source file. With these changes various resources are all set automatically from .h files.
1 parent 2eb07f0 commit d2d2b20

10 files changed

Lines changed: 119 additions & 0 deletions

Mac/Build/Python.prj

-5.69 KB
Binary file not shown.

Mac/Build/PythonApplet.prj

4.32 KB
Binary file not shown.

Mac/Build/PythonCore.prj

24 Bytes
Binary file not shown.

Mac/Build/PythonCoreCFM68K.prj

6.31 KB
Binary file not shown.

Mac/Build/PythonCorePPC.prj

48 Bytes
Binary file not shown.

Mac/Build/PythonStandSmall.prj

48 Bytes
Binary file not shown.

Mac/Build/PythonStandalone.prj

72 Bytes
Binary file not shown.

Mac/Resources/bundle.rsrc

-85 Bytes
Binary file not shown.

Mac/Resources/pythonpath.r

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
** Resources for the sys.path initialization, the Python options
3+
** and the preference filename
4+
*/
5+
#include "Types.r"
6+
#include "patchlevel.h"
7+
#include "pythonresources.h"
8+
9+
/* A few resource type declarations */
10+
11+
type 'Popt' {
12+
literal byte version = POPT_VERSION_CURRENT;
13+
byte noInspect = 0, inspect = 1;
14+
byte noVerbose = 0, verbose = 1;
15+
byte noOptimize = 0, optimize = 1;
16+
byte noUnbuffered = 0, unbuffered = 1;
17+
byte noDebugParser = 0, debugParser = 1;
18+
byte closeOnNormalExit = 0, noCloseOnNormalExit = 1;
19+
byte closeOnErrorExit = 0, noCloseOnErrorExit = 1;
20+
byte interactiveOptions = 0, noInteractiveOptions = 1;
21+
byte argcArgv = 0, noArgcArgv = 1;
22+
byte newStandardExceptions = 0, oldStandardExceptions = 1;
23+
byte sitePython = 0, noSitePython = 1;
24+
};
25+
26+
type 'TMPL' {
27+
wide array {
28+
pstring;
29+
literal longint;
30+
};
31+
};
32+
33+
/* The resources themselves */
34+
35+
/* Popt template, for editing them in ResEdit */
36+
37+
resource 'TMPL' (PYTHONOPTIONS_ID, "Popt") {
38+
{
39+
"preference version", 'DBYT',
40+
"Interactive after script", 'DBYT',
41+
"Verbose import", 'DBYT',
42+
"Optimize", 'DBYT',
43+
"Unbuffered stdio", 'DBYT',
44+
"Debug parser", 'DBYT',
45+
"Keep window on normal exit", 'DBYT',
46+
"Keep window on error exit", 'DBYT',
47+
"No interactive option dialog", 'DBYT',
48+
"No argc/argv emulation", 'DBYT',
49+
"Old standard exceptions", 'DBYT',
50+
"No site-python support", 'DBYT',
51+
}
52+
};
53+
54+
/* The default-default Python options */
55+
56+
resource 'Popt' (PYTHONOPTIONS_ID, "Options") {
57+
POPT_VERSION_CURRENT,
58+
noInspect,
59+
noVerbose,
60+
noOptimize,
61+
noUnbuffered,
62+
noDebugParser,
63+
closeOnNormalExit,
64+
noCloseOnErrorExit,
65+
interactiveOptions,
66+
argcArgv,
67+
newStandardExceptions,
68+
sitePython,
69+
};
70+
71+
/* The sys.path initializer */
72+
73+
resource 'STR#' (PYTHONPATH_ID, "sys.path initialization") {
74+
{
75+
"$(PYTHON)",
76+
"$(PYTHON):Lib",
77+
"$(PYTHON):Mac:PlugIns",
78+
"$(PYTHON):Mac:Lib",
79+
"$(PYTHON):Mac:Lib:lib-toolbox",
80+
"$(PYTHON):Mac:Lib:lib-scripting",
81+
"$(PYTHON):Extensions:img:Lib"
82+
}
83+
};
84+
85+
/* The preferences filename */
86+
87+
resource 'STR ' (PREFFILENAME_ID, PREFFILENAME_PASCAL_NAME) {
88+
$$Format("Python %s Preferences", PY_VERSION)
89+
};

Mac/Resources/version.r

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
** Create the 'vers' version resource from information in the
3+
** Python include files.
4+
*/
5+
6+
#include "Types.r"
7+
8+
#include "patchlevel.h"
9+
10+
/* Invent the Mac version from the Python version */
11+
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA
12+
#define V_RELEASE alpha
13+
#endif
14+
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA
15+
#define V_RELEASE beta
16+
#endif
17+
#ifndef V_RELEASE
18+
#define V_RELEASE final
19+
#endif
20+
21+
resource 'vers' (1) {
22+
PY_MAJOR_VERSION,
23+
(PY_MINOR_VERSION<<4) | (PY_MICRO_VERSION),
24+
V_RELEASE,
25+
PY_RELEASE_SERIAL,
26+
0,
27+
PY_VERSION,
28+
$$Format("%s, © Stichting Mathematisch Centrum %s",
29+
PY_VERSION, $$Date)
30+
};

0 commit comments

Comments
 (0)