[Twisted-web] Proposed backwards-incompatible changes to nevow (formless)
Christopher Armstrong
twisted-web@twistedmatrix.com
Fri, 30 Jan 2004 21:13:10 -0500
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigB0EE60750EFE590C6C18B19E
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
1. from gtk2form.py:
# [:-1] is a *terrible* hack: formless sticks a Submit
# button in the return value of getArgs when the
# binding doesn't specify any other Buttons. It
# *shouldn't* do this: it's lying about what arguments
# the function will accept. It should rely on the user
# interface-generater (like freeform and gtk2form) to
# handle the case where no buttons are specified. That
# way I can know whether or not a button should really
# produce an argument to the method.
deferred.callback(m(*values[:-1]))
that says it all.
2. The way Typed.coerce and coerceWithBinding work are really stupid.
For one, they're both optional: all code that wants to talk the
interface has to say:
if hasattr(o, 'coerceWithBinding'):
o.coerceWithBinding(val, configurable)
elif hasattr(o, 'coerce'):
o.coerce(val)
It should just be required on the interface. Implementors can
implement with pass quite easily.
For two, coerceWithBinding is a terrible name when the binding isn't
what's being passed, but the configurable.
And for three, there's really no reason to have both methods -- if a
coercion doesn't require the configurable to do anything, it can just
ignore the argument.
Solution: There should just be coerce(val, configurable) on the
interface, always required.
2 doesn't bother me as much as 1 does: it's a real problem that I can't
think any way to get around for a complete implementation of a formless UI.
DP, do you agree with these changes? I can make patches for nevow and
all usages of them in Quotient, too.
--
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
---------+ http://radix.twistedmatrix.com/
--------------enigB0EE60750EFE590C6C18B19E
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAGw82Np279O1/OG4RAvzOAJ94MTIfuNPCwSMbYSSKpQictYxc/wCfd84k
xq3GeHu60BPlJgCHABMfiS4=
=2ZJ6
-----END PGP SIGNATURE-----
--------------enigB0EE60750EFE590C6C18B19E--