Revision: 4301
http://jython.svn.sourceforge.net/jython/?rev=4301&view=rev
Author: pjenvey
Date: 2008-04-05 13:10:55 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
whitespace
Modified Paths:
--------------
trunk/jython/src/org/python/core/PyObject.java
Modified: trunk/jython/src/org/python/core/PyObject.java
===================================================================
--- trunk/jython/src/org/python/core/PyObject.java 2008-04-05 05:16:18 UTC (rev 4300)
+++ trunk/jython/src/org/python/core/PyObject.java 2008-04-05 20:10:55 UTC (rev 4301)
@@ -2969,18 +2969,17 @@
final PyObject object___reduce_ex__(int arg) {
PyObject res;
- PyObject clsreduce=this.getType().__findattr__("__reduce__");
- PyObject objreduce=(new PyObject()).getType().__findattr__("__reduce__");
+ PyObject clsreduce = this.getType().__findattr__("__reduce__");
+ PyObject objreduce = (new PyObject()).getType().__findattr__("__reduce__");
- if (clsreduce!=objreduce) {
- res=this.__reduce__();
- } else if (arg>=2) {
- res=reduce_2();
+ if (clsreduce != objreduce) {
+ res = this.__reduce__();
+ } else if (arg >= 2) {
+ res = reduce_2();
} else {
- PyObject copyreg=__builtin__.__import__("copy_reg", null, null,
- Py.EmptyTuple);
- PyObject copyreg_reduce=copyreg.__findattr__("_reduce_ex");
- res=copyreg_reduce.__call__(this, new PyInteger(arg));
+ PyObject copyreg = __builtin__.__import__("copy_reg", null, null, Py.EmptyTuple);
+ PyObject copyreg_reduce = copyreg.__findattr__("_reduce_ex");
+ res = copyreg_reduce.__call__(this, new PyInteger(arg));
}
return res;
}
@@ -2988,17 +2987,15 @@
private static PyObject slotnames(PyObject cls) {
PyObject slotnames;
- slotnames=cls.__findattr__("__slotnames__");
- if(null!=slotnames) {
+ slotnames = cls.__findattr__("__slotnames__");
+ if (null != slotnames) {
return slotnames;
}
- PyObject copyreg=__builtin__.__import__("copy_reg", null, null,
- Py.EmptyTuple);
- PyObject copyreg_slotnames=copyreg.__findattr__("_slotnames");
- slotnames=copyreg_slotnames.__call__(cls);
- if (null!=slotnames && Py.None!=slotnames &&
- (!(slotnames instanceof PyList))) {
+ PyObject copyreg = __builtin__.__import__("copy_reg", null, null, Py.EmptyTuple);
+ PyObject copyreg_slotnames = copyreg.__findattr__("_slotnames");
+ slotnames = copyreg_slotnames.__call__(cls);
+ if (null != slotnames && Py.None != slotnames && (!(slotnames instanceof PyList))) {
throw Py.TypeError("copy_reg._slotnames didn't return a list or None");
}
@@ -3007,35 +3004,35 @@
private PyObject reduce_2() {
PyObject args, state;
- PyObject res=null;
+ PyObject res = null;
int n,i;
- PyObject cls=this.__findattr__("__class__");
+ PyObject cls = this.__findattr__("__class__");
- PyObject getnewargs=this.__findattr__("__getnewargs__");
- if (null!=getnewargs) {
- args=getnewargs.__call__();
- if (null!=args && !(args instanceof PyTuple)) {
+ PyObject getnewargs = this.__findattr__("__getnewargs__");
+ if (null != getnewargs) {
+ args = getnewargs.__call__();
+ if (null != args && !(args instanceof PyTuple)) {
throw Py.TypeError("__getnewargs__ should return a tuple");
}
} else {
- args=Py.EmptyTuple;
+ args = Py.EmptyTuple;
}
- PyObject getstate=this.__findattr__("__getstate__");
- if (null!=getstate) {
- state=getstate.__call__();
- if (null==state) {
+ PyObject getstate = this.__findattr__("__getstate__");
+ if (null != getstate) {
+ state = getstate.__call__();
+ if (null == state) {
return res;
}
} else {
- state=this.__findattr__("__dict__");
- if (null==state) {
- state=Py.None;
+ state = this.__findattr__("__dict__");
+ if (null == state) {
+ state = Py.None;
}
- PyObject names=slotnames(cls);
- if (null==names) {
+ PyObject names = slotnames(cls);
+ if (null == names) {
return res;
}
@@ -3043,51 +3040,48 @@
if (!(names instanceof PyList)) {
throw Py.AssertionError("slots not a list");
}
- PyObject slots=new PyDictionary();
+ PyObject slots = new PyDictionary();
- n=0;
- for (i=0;i<((PyList)names).size();i++) {
- PyObject name=((PyList)names).pyget(i);
- PyObject value=this.__findattr__(name.toString());
- if (null==value) {
+ n = 0;
+ for (i = 0; i < ((PyList)names).size(); i++) {
+ PyObject name = ((PyList)names).pyget(i);
+ PyObject value = this.__findattr__(name.toString());
+ if (null == value) {
// do nothing
} else {
slots.__setitem__(name, value);
n++;
}
}
- if (n>0) {
- state=new PyTuple(state, slots);
+ if (n > 0) {
+ state = new PyTuple(state, slots);
}
}
}
PyObject listitems;
PyObject dictitems;
if (!(this instanceof PyList)) {
- listitems=Py.None;
+ listitems = Py.None;
} else {
- listitems=((PyList)this).__iter__();
+ listitems = ((PyList)this).__iter__();
}
if (!(this instanceof PyDictionary)) {
- dictitems=Py.None;
+ dictitems = Py.None;
} else {
- dictitems=((PyDictionary)this).iteritems();
+ dictitems = ((PyDictionary)this).iteritems();
}
- PyObject copyreg=__builtin__.__import__("copy_reg", null, null,
- Py.EmptyTuple);
- PyObject newobj=copyreg.__findattr__("__newobj__");
+ PyObject copyreg = __builtin__.__import__("copy_reg", null, null, Py.EmptyTuple);
+ PyObject newobj = copyreg.__findattr__("__newobj__");
- n=((PyTuple)args).size();
- PyObject args2[]=new PyObject[n+1];
- args2[0]=cls;
- for(i=0;i<n;i++) {
- args2[i+1]=((PyTuple)args).pyget(i);
+ n = ((PyTuple)args).size();
+ PyObject args2[] = new PyObject[n+1];
+ args2[0] = cls;
+ for(i = 0; i < n; i++) {
+ args2[i+1] = ((PyTuple)args).pyget(i);
}
- res = new PyTuple(newobj, new PyTuple(args2), state, listitems, dictitems);
-
- return res;
+ return new PyTuple(newobj, new PyTuple(args2), state, listitems, dictitems);
}
public PyTuple __getnewargs__() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|