From: <pj...@us...> - 2009-10-14 06:37:57
|
Revision: 6857 http://jython.svn.sourceforge.net/jython/?rev=6857&view=rev Author: pjenvey Date: 2009-10-14 06:37:50 +0000 (Wed, 14 Oct 2009) Log Message: ----------- add classmethod docs Modified Paths: -------------- trunk/jython/src/org/python/core/PyClassMethodDescr.java trunk/jython/src/org/python/core/PyDictionary.java trunk/jython/src/org/python/core/PyFloat.java trunk/jython/src/org/python/expose/ExposedClassMethod.java Modified: trunk/jython/src/org/python/core/PyClassMethodDescr.java =================================================================== --- trunk/jython/src/org/python/core/PyClassMethodDescr.java 2009-10-14 06:02:01 UTC (rev 6856) +++ trunk/jython/src/org/python/core/PyClassMethodDescr.java 2009-10-14 06:37:50 UTC (rev 6857) @@ -1,5 +1,7 @@ +/* Copyright (c) Jython Developers */ package org.python.core; +import org.python.expose.ExposedGet; import org.python.expose.ExposedMethod; import org.python.expose.ExposedType; @@ -8,10 +10,11 @@ public static final PyType TYPE = PyType.fromClass(PyClassMethodDescr.class); - PyClassMethodDescr(PyType t, PyBuiltinCallable meth) { - super(t, meth); + PyClassMethodDescr(PyType type, PyBuiltinCallable meth) { + super(type, meth); } + @Override public PyObject __get__(PyObject obj, PyObject type) { return classmethod_descriptor___get__(obj, type); } @@ -33,4 +36,10 @@ checkGetterType((PyType)type); return meth.bind(type); } + + @Override + @ExposedGet(name = "__doc__") + public String getDoc() { + return super.getDoc(); + } } Modified: trunk/jython/src/org/python/core/PyDictionary.java =================================================================== --- trunk/jython/src/org/python/core/PyDictionary.java 2009-10-14 06:02:01 UTC (rev 6856) +++ trunk/jython/src/org/python/core/PyDictionary.java 2009-10-14 06:37:50 UTC (rev 6857) @@ -92,7 +92,7 @@ return dict_fromkeys(TYPE, keys, value); } - @ExposedClassMethod(defaults = "Py.None") + @ExposedClassMethod(defaults = "Py.None", doc = BuiltinDocs.dict_fromkeys_doc) final static PyObject dict_fromkeys(PyType type, PyObject keys, PyObject value) { PyObject d = type.__call__(); for (PyObject o : keys.asIterable()) { Modified: trunk/jython/src/org/python/core/PyFloat.java =================================================================== --- trunk/jython/src/org/python/core/PyFloat.java 2009-10-14 06:02:01 UTC (rev 6856) +++ trunk/jython/src/org/python/core/PyFloat.java 2009-10-14 06:37:50 UTC (rev 6857) @@ -647,7 +647,7 @@ public static volatile Format double_format = Format.BE; public static volatile Format float_format = Format.BE; - @ExposedClassMethod + @ExposedClassMethod(doc = BuiltinDocs.float___getformat___doc) public static String float___getformat__(PyType type, String typestr) { if ("double".equals(typestr)) { return double_format.format(); @@ -658,7 +658,7 @@ } } - @ExposedClassMethod + @ExposedClassMethod(doc = BuiltinDocs.float___setformat___doc) public static void float___setformat__(PyType type, String typestr, String format) { Format new_format = null; if (!"double".equals(typestr) && !"float".equals(typestr)) { Modified: trunk/jython/src/org/python/expose/ExposedClassMethod.java =================================================================== --- trunk/jython/src/org/python/expose/ExposedClassMethod.java 2009-10-14 06:02:01 UTC (rev 6856) +++ trunk/jython/src/org/python/expose/ExposedClassMethod.java 2009-10-14 06:37:50 UTC (rev 6857) @@ -22,4 +22,9 @@ * @return default arguments. Starts at the number of arguments - defaults.length. */ String[] defaults() default {}; + + /** + * Returns the __doc__ String for this method. + */ + String doc() default ""; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |