On 30 juillet 09:34, Derek Harland wrote: > Hi Sylvain Hi, > * Am returning a newer patch to you for raw_building.py --- problem > here is that __name__ doesn't even exist so this patch just replaces > constructs like > member.__name__ or localname > with > getattr(member, '__name__', None) or localname > > to ensure that both blanks and missing get mapped to localname.
done. > * Just to note also, your patch seemed to be against an older > version of raw_building.py than I have (comes from the 0.19 > release). it was actually the diff with the head revision in our repository (url nico gave to you). Attached is a diff with the 0.19 version of this file. > * I'll be folding these patches into the macports project ... would > you be so kind as to let me know when a new release comes along that > no longer needs them? sure, new versions are announced on this list. -- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org
30c30 < --- > 46c46 < --- > 110c110 < --- > 126,127c126 < < def object_build_class(node, member): --- > def object_build_class(node, member, localname): 130c129,130 < return _base_class_object_build(node, member, basenames) --- > return _base_class_object_build(node, member, basenames, > localname=localname) 132c132 < def object_build_function(node, member): --- > def object_build_function(node, member, localname): 139,141c139,141 < func = build_function(member.__name__, args, defaults, < member.func_code.co_flags, member.__doc__) < node.add_local_node(func) --- > func = build_function(getattr(member, '__name__', None) or localname, args, > defaults, member.func_code.co_flags, member.__doc__) > node.add_local_node(func, localname) 147c147 < def object_build_methoddescriptor(node, member): --- > def object_build_methoddescriptor(node, member, localname): 150c150,151 < func = build_function(member.__name__, doc=member.__doc__) --- > func = build_function(getattr(member, '__name__', None) or localname, > doc=member.__doc__) 153,154d153 < func.args = nodes.Arguments() < # arg values are not defined on an _ast node 156,159c155 < func.args.defaults = None < func.args.vararg = None < func.args.kwarg = None < node.add_local_node(func) --- > node.add_local_node(func, localname) 161c157 < def _base_class_object_build(node, member, basenames, name=None): --- > def _base_class_object_build(node, member, basenames, name=None, localname=None): 165c161,162 < klass = build_class(name or member.__name__, basenames, member.__doc__) --- > klass = build_class(name or getattr(member, '__name__', None) or localname, > basenames, member.__doc__) 167c164 < node.add_local_node(klass) --- > node.add_local_node(klass, localname) 189,190c186,187 < __all__ = ('register_arguments', 'build_module', < 'object_build_class', 'object_build_function', --- > __all__ = ('register_arguments', 'build_module', > 'object_build_class', 'object_build_function',
_______________________________________________ Python-Projects mailing list Python-Projects@lists.logilab.org http://lists.logilab.org/mailman/listinfo/python-projects