[Zope-CVS] CVS: Packages/Spread - LICENSE:1.1 setup.py:1.2 spreadmodule.c:1.2 testspread.py:1.2

Jeremy Hylton jeremy@zope.com
Fri, 28 Sep 2001 13:07:56 -0400


Update of /cvs-repository/Packages/Spread
In directory cvs.zope.org:/tmp/cvs-serv28348

Modified Files:
	setup.py spreadmodule.c testspread.py 
Added Files:
	LICENSE 
Log Message:
Mark files with ZPL 1.1


=== Added File Packages/Spread/LICENSE ===
Zope Public License (ZPL) Version 1.1

Copyright (c) Zope Corporation.  All rights reserved.

This license has been certified as open source.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   1. Redistributions in source code must retain the above copyright
      notice, this list of conditions, and the following disclaimer.

   2. Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions, and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

   3. All advertising materials and documentation mentioning features
      derived from or use of this software must display the following
      acknowledgement:

      "This product includes software developed by Zope Corporation
      for use in the Z Object Publishing Environment
      (http://www.zope.com/)."

      In the event that the product being advertised includes an
      intact Zope distribution (with copyright and license included)
      then this clause is waived.

   4. Names associated with Zope or Zope Corporation must not be used
      to endorse or promote products derived from this software
      without prior written permission from Zope Corporation.

   5. Modified redistributions of any form whatsoever must retain
      the following acknowledgment:

      "This product includes software developed by Zope Corporation
      for use in the Z Object Publishing Environment
      (http://www.zope.com/)."

      Intact (re-)distributions of any official Zope release do not
      require an external acknowledgement.

   6. Modifications are encouraged but must be packaged separately as
      patches to official Zope releases.  Distributions that do not
      clearly separate the patches from the original work must be
      clearly labeled as unofficial distributions.  Modifications
      which do not carry the name Zope may be packaged in any form, as
      long as they conform to all of the clauses above.

Disclaimer

THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS'' AND ANY
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL ZOPE CORPORATION OR ITS
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of contributions made by Zope Corporation and
many individuals on behalf of Zope Corporation.  Specific attributions
are listed in the accompanying credits file.



=== Packages/Spread/setup.py 1.1 => 1.2 ===
 
+# Copyright (c) 2001 Zope Corporation and Contributors.  All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 1.1 (ZPL).  A copy of the ZPL should accompany this
+# distribution.  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
+# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
+# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+
 from distutils.core import setup, Extension
 
 SPREAD_DIR = "/usr/local/spread"


=== Packages/Spread/spreadmodule.c 1.1 => 1.2 ===
+
+   Copyright (c) 2001 Zope Corporation and Contributors.  All Rights Reserved.
+
+   This software is subject to the provisions of the Zope Public License,
+   Version 1.1 (ZPL).  A copy of the ZPL should accompany this
+   distribution.  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
+   EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
+   INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+
  */
 
 #include "Python.h"
@@ -21,6 +31,7 @@
     PyObject *private_group;
     int max_groups;
     int msg_size;
+    int disconnected;
 } MailboxObject;
 
 typedef struct {
@@ -349,6 +360,7 @@
     self->private_group = NULL;
     self->max_groups = MAX_GROUPS;
     self->msg_size = MSG_SIZE;
+    self->disconnected = 0;
     return self;
 }
 
@@ -357,6 +369,8 @@
 static void
 mailbox_dealloc(MailboxObject *self)
 {
+    if (self->disconnected == 0)
+	SP_disconnect(self->mbox);
     Py_DECREF(self->private_group);
     PyObject_Del(self);
 }
@@ -370,11 +384,20 @@
     err = SP_disconnect(self->mbox);
     if (err != 0)
 	return spread_error(err);
+    self->disconnected = 1;
     Py_INCREF(Py_None);
     return Py_None;
 }
 
 static PyObject *
+mailbox_fileno(MailboxObject *self, PyObject *args)
+{
+    if (!PyArg_ParseTuple(args, ":fileno"))
+	return NULL;
+    return PyInt_FromLong(self->mbox);
+}
+
+static PyObject *
 mailbox_join(MailboxObject *self, PyObject *args)
 {
     int err;
@@ -541,6 +564,7 @@
 
 static PyMethodDef Mailbox_methods[] = {
 	{"disconnect",	(PyCFunction)mailbox_disconnect,METH_VARARGS},
+	{"fileno",	(PyCFunction)mailbox_fileno,	METH_VARARGS},
 	{"join",	(PyCFunction)mailbox_join,	METH_VARARGS},
 	{"leave",	(PyCFunction)mailbox_leave,	METH_VARARGS},
 	{"multicast",   (PyCFunction)mailbox_multicast, METH_VARARGS},


=== Packages/Spread/testspread.py 1.1 => 1.2 ===
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 1.1 (ZPL).  A copy of the ZPL should accompany this
+# distribution.  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
+# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
+# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+
 import spread
 import time
 import unittest