Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Side by Side Diff: src/com/ziclix/python/sql/PyStatement.java

Issue 2888: __findattr__ refactor (Closed) SVN Base: https://jython.svn.sourceforge.net/svnroot/jython/branches/asm
Patch Set: This is the actually commited patch (on r5155), in case you have more comments Created 1 year, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Jython Database Specification API 2.0 2 * Jython Database Specification API 2.0
3 * 3 *
4 * $Id$ 4 * $Id$
5 * 5 *
6 * Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com> 6 * Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com>
7 * 7 *
8 */ 8 */
9 package com.ziclix.python.sql; 9 package com.ziclix.python.sql;
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 public String toString() { 154 public String toString() {
155 return __repr__().toString(); 155 return __repr__().toString();
156 } 156 }
157 157
158 /** 158 /**
159 * Gets the value of the attribute name. 159 * Gets the value of the attribute name.
160 * 160 *
161 * @param name 161 * @param name
162 * @return the attribute for the given name 162 * @return the attribute for the given name
163 */ 163 */
164 public PyObject __findattr__(String name) { 164 public PyObject __findattr_ex__(String name) {
165 165
166 if ("style".equals(name)) { 166 if ("style".equals(name)) {
167 return Py.newInteger(style); 167 return Py.newInteger(style);
168 } else if ("closed".equals(name)) { 168 } else if ("closed".equals(name)) {
169 return Py.newBoolean(closed); 169 return Py.newBoolean(closed);
170 } else if ("__statement__".equals(name)) { 170 } else if ("__statement__".equals(name)) {
171 return Py.java2py(statement); 171 return Py.java2py(statement);
172 } else if ("__methods__".equals(name)) { 172 } else if ("__methods__".equals(name)) {
173 return __methods__; 173 return __methods__;
174 } else if ("__members__".equals(name)) { 174 } else if ("__members__".equals(name)) {
175 return __members__; 175 return __members__;
176 } 176 }
177 177
178 return super.__findattr__(name); 178 return super.__findattr_ex__(name);
179 } 179 }
180 180
181 /** 181 /**
182 * Initializes the object's namespace. 182 * Initializes the object's namespace.
183 * 183 *
184 * @param dict 184 * @param dict
185 */ 185 */
186 static public void classDictInit(PyObject dict) { 186 static public void classDictInit(PyObject dict) {
187 187
188 dict.__setitem__("__version__", Py.newString("$Revision$").__getslice__( Py.newInteger(11), Py.newInteger(-2), null)); 188 dict.__setitem__("__version__", Py.newString("$Revision$").__getslice__( Py.newInteger(11), Py.newInteger(-2), null));
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 try { 325 try {
326 this.statement.close(); 326 this.statement.close();
327 } catch (SQLException e) { 327 } catch (SQLException e) {
328 throw zxJDBC.makeException(e); 328 throw zxJDBC.makeException(e);
329 } finally { 329 } finally {
330 this.closed = true; 330 this.closed = true;
331 } 331 }
332 } 332 }
333 } 333 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r483