Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv26430
Modified Files:
Py.java PyClass.java
Log Message:
Cleaned the PyClass ctors and added comments.
Index: Py.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v
retrieving revision 2.39
retrieving revision 2.40
diff -C2 -r2.39 -r2.40
*** Py.java 2001/02/22 11:10:38 2.39
--- Py.java 2001/03/04 18:08:02 2.40
***************
*** 423,427 ****
public static PyObject newJavaFunc(Class cls, String name) {
try {
! java.lang.reflect.Method m = cls.getMethod(name, new Class[] {
PyObject[].class, String[].class });
return new JavaFunc(m);
--- 423,427 ----
public static PyObject newJavaFunc(Class cls, String name) {
try {
! java.lang.reflect.Method m = cls.getMethod(name, new Class[] {
PyObject[].class, String[].class });
return new JavaFunc(m);
***************
*** 1335,1344 ****
}
! PyClass pyclass = new PyClass();
! if (proxyClass != null)
! pyclass.proxyClass = proxyClass;
!
! pyclass.init(name, new PyTuple(bases), dict);
! return pyclass;
}
--- 1335,1339 ----
}
! return new PyClass(name, new PyTuple(bases), dict, proxyClass);
}
***************
*** 1578,1582 ****
/**
! * A function object wrapper for a java method which comply with the
* PyArgsKeywordsCall standard.
*/
--- 1573,1577 ----
/**
! * A function object wrapper for a java method which comply with the
* PyArgsKeywordsCall standard.
*/
Index: PyClass.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/PyClass.java,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -r2.21 -r2.22
*** PyClass.java 2001/02/25 16:57:01 2.21
--- PyClass.java 2001/03/04 18:08:02 2.22
***************
*** 41,49 ****
}
- public PyClass() {
- super(__class__);
- proxyClass = null;
- }
-
protected PyClass(PyClass c) {
super(c);
--- 41,44 ----
***************
*** 51,56 ****
}
public PyClass(String name, PyTuple bases, PyObject dict) {
! this();
init(name, bases, dict);
}
--- 46,83 ----
}
+
+ /**
+ * Create a python class.
+ *
+ * @param name name of the class.
+ * @param bases A list of base classes.
+ * @param dict The class dict. Normally this dict is returned by
+ * the class code object.
+ *
+ * @see org.python.core.Py#makeClass(String, PyObject[], PyCode, PyObject)
+ */
public PyClass(String name, PyTuple bases, PyObject dict) {
! this(name, bases, dict, null);
! }
!
! /**
! * Create a python class which inherit from a java class and where
! * we already have generated a proxyclass. If we do not have a
! * pre-generated proxyclass, the class initialization method will
! * create such a proxyclass if bases contain a java class.
! *
! * @param name name of the class.
! * @param bases A list of base classes.
! * @param dict The class dict. Normally this dict is returned by
! * the class code object.
! *
! * @see org.python.core.Py#makeClass(String, PyObject[], PyCode,
! * PyObject, Class)
! */
! public PyClass(String name, PyTuple bases, PyObject dict,
! Class proxyClass)
! {
! super(__class__);
! this.proxyClass = proxyClass;
init(name, bases, dict);
}
|