Commit e4485b06 authored by Guido van Rossum's avatar Guido van Rossum

Setup.in: added tkinter; rearranged the definition of PYTHONPATH so

that the module-specific components are in the section for that
module.

cursesmodule.c: patched it so it actually works.

tkintermodule.c: call Py_AtExit instead of atexit().

signalmodule.c: converted to new naming style; added
BGN/END SAVE around pause() call.

socketmodule.c: added setblocking() after Tommy Burnette.
parent a1426136
...@@ -53,10 +53,7 @@ TESTPATH=:$(DESTLIB)/test ...@@ -53,10 +53,7 @@ TESTPATH=:$(DESTLIB)/test
# Enable this for Sun systems # Enable this for Sun systems
#ARCHPATH=:$(DESTLIB)/sun4 #ARCHPATH=:$(DESTLIB)/sun4
# Enable this if stdwin installed PYTHONPATH=.:$(DESTLIB)$(TESTPATH)$(ARCHPATH)$(STDWINPATH)$(TKPATH)
#STDWINPATH=:$(DESTLIB)/stdwin
PYTHONPATH=.:$(DESTLIB)$(TESTPATH)$(ARCHPATH)$(STDWINPATH)
# Modules that should always be present (non UNIX dependent) # Modules that should always be present (non UNIX dependent)
...@@ -104,12 +101,13 @@ rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably) ...@@ -104,12 +101,13 @@ rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably)
# ftp://ftp.cwi.nl/pub/stdwin. The STDWIN variable must point to the # ftp://ftp.cwi.nl/pub/stdwin. The STDWIN variable must point to the
# STDWIN toplevel directory. The ARCH variable must be set to the # STDWIN toplevel directory. The ARCH variable must be set to the
# architecture identifier used to build STDWIN. NB if you combine this # architecture identifier used to build STDWIN. NB if you combine this
# with the gl module on an SGI machine, you should replace "-lX11" with # with the gl module on an SGI IRIX 4 machine, you should replace
# "-lX11_s". "-lX11" with "-lX11_s".
#STDWIN=/ufs/guido/src/stdwin #STDWIN=/ufs/guido/src/stdwin
#ARCH=??? #ARCH=???
#stdwin stdwinmodule.c -I$(STDWIN)/H $(STDWIN)/Build/$(ARCH)/x11/lib/lib.a -lX11 #stdwin stdwinmodule.c -I$(STDWIN)/H $(STDWIN)/Build/$(ARCH)/x11/lib/lib.a -lX11
#STDWINPATH=:$(DESTLIB)/stdwin
# The md5 module implements the RSA Data Security, Inc. MD5 # The md5 module implements the RSA Data Security, Inc. MD5
...@@ -174,8 +172,18 @@ md5 md5module.c md5c.c ...@@ -174,8 +172,18 @@ md5 md5module.c md5c.c
# timing timingmodule.c # timing timingmodule.c
# Steen Lumholt's tkinter module. For use with plain Tk, use the
# first line. For use with extended Tk, edit tkappinit.c, add
# appropriate -DWITH_... and libraries/objects to the second line, and
# use that. In all cases also enable the last line (TKPATH).
#tkinter tkintermodule.c -I/usr/local/include -L/usr/local/lib -ltk -ltcl -lX11
#tkinter tkintermodule.c tkappinit.c -DWITH_APPINIT -I/usr/local/include -L/usr/local/lib -ltk -ltcl -lX11
#TKPATH=:$(DESTLIB)/tkinter
# Lance Ellinghouse's modules # Lance Ellinghouse's modules
rotor rotormodule.c # enigma-inspired en-, decryption rotor rotormodule.c # enigma-inspired encryption
# syslog syslogmodule.c # syslog daemon interface # syslog syslogmodule.c # syslog daemon interface
# curses cursesmodule.c -lcurses -ltermcap # guess what? # curses cursesmodule.c -lcurses -ltermcap # guess what?
......
...@@ -1033,6 +1033,8 @@ static PyTypeObject PyCursesPad_Type = { ...@@ -1033,6 +1033,8 @@ static PyTypeObject PyCursesPad_Type = {
/* -------------------------------------------------------*/ /* -------------------------------------------------------*/
static PyObject *ModDict;
static PyObject * static PyObject *
PyCurses_InitScr(self, args) PyCurses_InitScr(self, args)
PyObject * self; PyObject * self;
...@@ -1052,7 +1054,7 @@ PyCurses_InitScr(self, args) ...@@ -1052,7 +1054,7 @@ PyCurses_InitScr(self, args)
/* This was moved from initcurses() because core dumped on SGI */ /* This was moved from initcurses() because core dumped on SGI */
#define SetDictChar(string,ch) \ #define SetDictChar(string,ch) \
PyDict_SetItemString(d,string,PyInt_FromLong(ch)); PyDict_SetItemString(ModDict,string,PyInt_FromLong(ch));
/* Here are some graphic symbols you can use */ /* Here are some graphic symbols you can use */
SetDictChar("ACS_ULCORNER",(ACS_ULCORNER)); SetDictChar("ACS_ULCORNER",(ACS_ULCORNER));
...@@ -1387,6 +1389,7 @@ initcurses() ...@@ -1387,6 +1389,7 @@ initcurses()
Py_INCREF(PyCurses_ERR); Py_INCREF(PyCurses_ERR);
/* Add some symbolic constants to the module */ /* Add some symbolic constants to the module */
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
ModDict = d; /* For PyCurses_InitScr */
/* Make the version available */ /* Make the version available */
PyDict_SetItemString(d,"version", PyDict_SetItemString(d,"version",
......
...@@ -1092,8 +1092,9 @@ PyInit_tkinter () ...@@ -1092,8 +1092,9 @@ PyInit_tkinter ()
if (!inited) if (!inited)
{ {
inited = 1; inited = 1;
if (atexit (Tkinter_Cleanup)) if (Py_AtExit (Tkinter_Cleanup) != 0)
PyErr_SetFromErrno (Tkinter_TclError); fprintf(stderr,
"Tkinter: warning: cleanup procedure not registered\n");
} }
if (PyErr_Occurred ()) if (PyErr_Occurred ())
......
This diff is collapsed.
...@@ -63,6 +63,7 @@ Socket methods: ...@@ -63,6 +63,7 @@ Socket methods:
- s.recvfrom(nbytes [,flags]) --> string, sockaddr - s.recvfrom(nbytes [,flags]) --> string, sockaddr
- s.send(string [,flags]) --> nbytes - s.send(string [,flags]) --> nbytes
- s.sendto(string, [flags,] sockaddr) --> nbytes - s.sendto(string, [flags,] sockaddr) --> nbytes
- s.setblocking(1 | 0) --> None
- s.shutdown(how) --> None - s.shutdown(how) --> None
- s.close() --> None - s.close() --> None
...@@ -80,6 +81,7 @@ Socket methods: ...@@ -80,6 +81,7 @@ Socket methods:
#include <netdb.h> #include <netdb.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <fcntl.h>
#else #else
#include <winsock.h> #include <winsock.h>
#endif #endif
...@@ -441,6 +443,34 @@ BUILD_FUNC_DEF_2(sock_allowbroadcast,sockobject *,s, object *,args) ...@@ -441,6 +443,34 @@ BUILD_FUNC_DEF_2(sock_allowbroadcast,sockobject *,s, object *,args)
#endif #endif
#ifndef NT
/* s.setblocking(1 | 0) method */
static object *
sock_setblocking(s, args)
sockobject *s;
object *args;
{
int block;
int delay_flag;
if (!getintarg(args, &block))
return NULL;
BGN_SAVE
delay_flag = fcntl (s->sock_fd, F_GETFL, 0);
if (block)
delay_flag &= (~O_NDELAY);
else
delay_flag |= O_NDELAY;
fcntl (s->sock_fd, F_SETFL, delay_flag);
END_SAVE
INCREF(None);
return None;
}
#endif
/* s.setsockopt() method. /* s.setsockopt() method.
With an integer third argument, sets an integer option. With an integer third argument, sets an integer option.
With a string third argument, sets an option from a buffer; With a string third argument, sets an option from a buffer;
...@@ -812,6 +842,9 @@ static struct methodlist sock_methods[] = { ...@@ -812,6 +842,9 @@ static struct methodlist sock_methods[] = {
{"accept", (method)sock_accept}, {"accept", (method)sock_accept},
#if 0 #if 0
{"allowbroadcast", (method)sock_allowbroadcast}, {"allowbroadcast", (method)sock_allowbroadcast},
#endif
#ifndef NT
{"setblocking", (method)sock_setblocking},
#endif #endif
{"setsockopt", (method)sock_setsockopt}, {"setsockopt", (method)sock_setsockopt},
{"getsockopt", (method)sock_getsockopt}, {"getsockopt", (method)sock_getsockopt},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment