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

Skip to content

Commit 950a126

Browse files
committed
New versions of almost all files.
1 parent 2b65444 commit 950a126

23 files changed

Lines changed: 22150 additions & 15872 deletions

PC/config.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ extern void initaudioop();
3434
extern void initbinascii();
3535
extern void initcmath();
3636
extern void initenvironment();
37+
extern void initerrno();
3738
extern void initimageop();
3839
extern void initmath();
3940
extern void initmd5();
4041
extern void initnew();
4142
extern void initnt();
43+
extern void initoperator();
4244
extern void initregex();
4345
extern void initrgbimg();
4446
extern void initrotor();
@@ -64,11 +66,13 @@ struct _inittab inittab[] = {
6466
{"binascii", initbinascii},
6567
{"cmath", initcmath},
6668
{"environment", initenvironment},
69+
{"errno", initerrno},
6770
{"imageop", initimageop},
6871
{"math", initmath},
6972
{"md5", initmd5},
7073
{"new", initnew},
7174
{"nt", initnt}, /* Use the NT os functions, not posix */
75+
{"operator", initoperator},
7276
{"regex", initregex},
7377
{"rgbimg", initrgbimg},
7478
{"rotor", initrotor},

PC/config.h

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ This is a manually maintained version used for the Watcom,
1010
Borland and and Microsoft Visual C++ compilers. It is a
1111
standard part of the Python distribution.
1212
13+
WINDOWS DEFINES:
14+
The code specific to Windows should be wrapped around one of
15+
the following #defines
16+
17+
MS_WIN32 - Code specific to the MS Win32 API
18+
MS_WIN16 - Code specific to the old 16 bit Windows API.
19+
MS_WINDOWS - Code specific to Windows, but all versions.
20+
MS_COREDLL - Code if the Python core is built as a DLL.
21+
22+
Note that the old defines "NT" and "WIN32" are still supported, but
23+
will soon be dropped.
24+
25+
Also note that neither "_M_IX86" or "_MSC_VER" should be used for
26+
any purpose other than "Windows Intel x86 specific" and "Microsoft
27+
compiler specific". Therefore, these should be very rare.
28+
1329
*/
1430

1531
/*
@@ -25,6 +41,8 @@ standard part of the Python distribution.
2541
#define DONT_HAVE_SIG_ALARM
2642
#define DONT_HAVE_SIG_PAUSE
2743
#define LONG_BIT 32
44+
#define PREFIX ""
45+
#define EXEC_PREFIX ""
2846

2947
/* Microsoft C defines _MSC_VER */
3048

@@ -33,12 +51,20 @@ standard part of the Python distribution.
3351
#define NT /* NT is obsolete - please use MS_WIN32 instead */
3452
#define MS_WIN32
3553
#define MS_WINDOWS
54+
55+
#ifdef MS_COREDLL /* Python core is in a DLL */
56+
#define main Py_Main
57+
#ifndef USE_DL_EXPORT
58+
#define USE_DL_IMPORT
59+
#endif /* !USE_DL_EXPORT */
60+
#endif /* MS_COREDLL */
61+
3662
#ifdef _M_IX86
3763
#define COMPILER "[MSC 32 bit (Intel)]"
3864
#else
3965
#define COMPILER "[MSC (Unknown)]"
4066
#endif
41-
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win"
67+
#define PYTHONPATH ".\\lib;.\\lib\\win"
4268
typedef int pid_t;
4369
#define WORD_BIT 32
4470
#pragma warning(disable:4113)
@@ -48,7 +74,6 @@ typedef int pid_t;
4874
#define HAVE_STRFTIME
4975
#define NT_THREADS
5076
#define WITH_THREAD
51-
#define _COMPLEX_DEFINED
5277
#ifndef NETSCAPE_PI
5378
#define USE_SOCKET
5479
#endif
@@ -58,7 +83,8 @@ typedef int pid_t;
5883
#ifdef USE_DL_EXPORT
5984
#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
6085
#endif
61-
#endif /* MS_WIN32 */
86+
87+
#endif /* _MSC_VER && > 850 */
6288

6389
#if defined(_MSC_VER) && _MSC_VER <= 850
6490
/* Start of defines for 16-bit Windows using VC++ 1.5 */
@@ -67,11 +93,10 @@ typedef int pid_t;
6793
#define MS_WIN16
6894
#define MS_WINDOWS
6995
#endif
70-
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win;c:\\python\\lib\\dos_8x3"
96+
#define PYTHONPATH ".;.\\lib;.\\lib\\win;.\\lib\\dos_8x3"
7197
#define IMPORT_8x3_NAMES
7298
typedef int pid_t;
7399
#define WORD_BIT 16
74-
#define _COMPLEX_DEFINED
75100
#pragma warning(disable:4113)
76101
#define memcpy memmove /* memcpy dangerous pointer wrap in Win 3.1 */
77102
#define hypot _hypot
@@ -109,7 +134,7 @@ int sscanf(const char *, const char *, ...);
109134
/* The Watcom compiler defines __WATCOMC__ */
110135
#ifdef __WATCOMC__
111136
#define COMPILER "[Watcom]"
112-
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win;c:\\python\\lib\\dos_8x3"
137+
#define PYTHONPATH ".;.\\lib;.\\lib\\win;.\\lib\\dos_8x3"
113138
#define IMPORT_8x3_NAMES
114139
#include <ctype.h>
115140
#include <direct.h>
@@ -144,7 +169,7 @@ typedef int pid_t;
144169
/* The Borland compiler defines __BORLANDC__ */
145170
#ifdef __BORLANDC__
146171
#define COMPILER "[Borland]"
147-
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win;c:\\python\\lib\\dos_8x3"
172+
#define PYTHONPATH ".;.\\lib;.\\lib\\win;.\\lib\\dos_8x3"
148173
#define IMPORT_8x3_NAMES
149174
#define HAVE_CLOCK
150175
#define HAVE_STRFTIME
@@ -153,6 +178,18 @@ typedef int pid_t;
153178
#endif
154179
#endif /* BORLANDC */
155180

181+
/* End of compilers - finish up */
182+
183+
#ifdef MS_WIN32
184+
#define PLATFORM "win32"
185+
#else
186+
#ifdef MS_WIN16
187+
#define PLATFORM "win16"
188+
#else
189+
#define PLATFORM "dos"
190+
#endif /* !MS_WIN16 */
191+
#endif /* !MS_WIN32 */
192+
156193
/* Fairly standard from here! */
157194

158195
/* Define if on AIX 3.
@@ -257,7 +294,7 @@ typedef int pid_t;
257294
This requires the "dl" library by Jack Jansen,
258295
ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
259296
Don't bother on IRIX 5, it already has dynamic linking using SunOS
260-
style shared libraries */
297+
style shared libraries */
261298
/* #undef WITH_SGI_DL */
262299

263300
/* Define if you want to emulate SGI (IRIX 4) dynamic linking.
@@ -268,7 +305,7 @@ typedef int pid_t;
268305
as well as the "GNU dld" library,
269306
ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z.
270307
Don't bother on SunOS 4 or 5, they already have dynamic linking using
271-
shared libraries */
308+
shared libraries */
272309
/* #undef WITH_DL_DLD */
273310

274311
/* Define if you want to compile in rudimentary thread support */

PC/make8x3.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#! /usr/local/bin/python
2+
3+
# This program reads all *.py and test/*.py in "libDir", and
4+
# copies those files with illegal DOS names to libDir/dos_8x3.
5+
# Names are illegal if they are longer than 8x3 chars or if they
6+
# contain uppercase chars. It also tests for name collisions.
7+
# You must first create the directory libDir/dos_8x3 yourself.
8+
# You should remove all files in dos_8x3 if you run it again.
9+
10+
# CHANGE libDir TO THE CORRECT DIRECTORY. RM dos_8x3/* FIRST.
11+
12+
import sys, os, regex, string
13+
14+
libDir = "./Lib" # Location of Python Lib
15+
16+
def make8x3():
17+
reg_uppercase = regex.compile("[A-Z]")
18+
collisions = {} # See if all names are unique in first 8 chars.
19+
destDir = os.path.join(libDir, "dos_8x3")
20+
if not os.path.isdir(destDir):
21+
print "Please create the directory", destDir, "first."
22+
err()
23+
while 1:
24+
ans = raw_input("Ok to copy to " + destDir + " [yn]? ")
25+
if not ans:
26+
continue
27+
elif ans[0] == "n":
28+
err()
29+
elif ans[0] == "y":
30+
break
31+
for dirname in libDir, os.path.join(libDir, "test"):
32+
for filename in os.listdir(dirname):
33+
if filename[-3:] == ".py":
34+
name = filename[0:-3]
35+
if len(name) > 8 or reg_uppercase.search(name) >= 0:
36+
shortName = string.lower(name[0:8])
37+
if collisions.has_key(shortName):
38+
print "Name not unique in first 8 chars:", collisions[shortName], name
39+
else:
40+
collisions[shortName] = name
41+
fin = open(os.path.join(dirname, filename), "r")
42+
dest = os.path.join(destDir, shortName + ".py")
43+
fout = open(dest, "w")
44+
fout.write(fin.read())
45+
fin.close()
46+
fout.close()
47+
os.chmod(dest, 0644)
48+
elif filename == "." or filename == "..":
49+
continue
50+
elif filename[-4:] == ".pyc":
51+
continue
52+
elif filename == "Makefile":
53+
continue
54+
else:
55+
parts = string.splitfields(filename, ".")
56+
if len(parts) > 2 or \
57+
len(parts[0]) > 8 or \
58+
reg_uppercase.search(filename) >= 0 or \
59+
(len(parts) > 1 and len(parts[1]) > 3):
60+
print "Illegal DOS name", os.path.join(dirname, filename)
61+
sys.exit(0)
62+
def err():
63+
print "No files copied."
64+
sys.exit(1)
65+
66+
67+
if __name__ == "__main__":
68+
make8x3()

PC/pyth_w31.def

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
NAME
2-
EXETYPE WINDOWS
3-
CODE PRELOAD MOVABLE DISCARDABLE
4-
DATA PRELOAD MOVABLE
5-
HEAPSIZE 4096
1+
NAME
2+
EXETYPE WINDOWS
3+
CODE PRELOAD MOVABLE DISCARDABLE
4+
DATA PRELOAD MOVABLE
5+
HEAPSIZE 4096

PC/python.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ EXPORTS
121121
PyImport_GetModuleDict
122122
PyImport_AddModule
123123
PyImport_ImportModule
124+
PyImport_ImportFrozenModule
125+
PyImport_FrozenModules
124126
PyImport_ReloadModule
125127
PyImport_Cleanup
126128
PyInt_FromLong

PC/python.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
project : n:\python\python-1.4b0b\pc\wat_os2\pyth_os2.exe n:\python\python-1&
2-
.4b0b\pc\wat_dos\pyth_dos.exe .SYMBOLIC
3-
4-
!include n:\python\python-1.4b0b\pc\wat_os2\pyth_os2.mk1
5-
!include n:\python\python-1.4b0b\pc\wat_dos\pyth_dos.mk1
1+
project : n:\python\python-1.4b2\pc\wat_os2\pyth_os2.exe n:\python\python-1.&
2+
4b2\pc\wat_dos\pyth_dos.exe .SYMBOLIC
3+
4+
!include n:\python\python-1.4b2\pc\wat_os2\pyth_os2.mk1
5+
!include n:\python\python-1.4b2\pc\wat_dos\pyth_dos.mk1

PC/python.wpj

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
40
2-
projectIdent
3-
0
4-
VpeMain
5-
1
6-
WRect
7-
0
8-
0
9-
9920
10-
8704
11-
2
12-
MProject
13-
3
14-
MCommand
15-
0
16-
4
17-
MCommand
18-
0
19-
2
20-
5
21-
WFileName
22-
20
23-
wat_os2\pyth_os2.tgt
24-
6
25-
WFileName
26-
20
27-
wat_dos\pyth_dos.tgt
28-
7
29-
WVList
30-
2
31-
8
32-
VComponent
33-
9
34-
WRect
35-
832
36-
256
37-
5632
38-
4096
39-
1
40-
0
41-
10
42-
WFileName
43-
20
44-
wat_os2\pyth_os2.tgt
45-
0
46-
0
47-
11
48-
VComponent
49-
12
50-
WRect
51-
0
52-
0
53-
5632
54-
4147
55-
0
56-
0
57-
13
58-
WFileName
59-
20
60-
wat_dos\pyth_dos.tgt
61-
0
62-
0
63-
11
1+
40
2+
projectIdent
3+
0
4+
VpeMain
5+
1
6+
WRect
7+
0
8+
0
9+
9920
10+
8704
11+
2
12+
MProject
13+
3
14+
MCommand
15+
0
16+
4
17+
MCommand
18+
0
19+
2
20+
5
21+
WFileName
22+
20
23+
wat_os2\pyth_os2.tgt
24+
6
25+
WFileName
26+
20
27+
wat_dos\pyth_dos.tgt
28+
7
29+
WVList
30+
2
31+
8
32+
VComponent
33+
9
34+
WRect
35+
832
36+
256
37+
5632
38+
4096
39+
0
40+
0
41+
10
42+
WFileName
43+
20
44+
wat_os2\pyth_os2.tgt
45+
12
46+
74
47+
11
48+
VComponent
49+
12
50+
WRect
51+
128
52+
85
53+
5632
54+
4113
55+
0
56+
0
57+
13
58+
WFileName
59+
20
60+
wat_dos\pyth_dos.tgt
61+
9
62+
9
63+
11

0 commit comments

Comments
 (0)