[Twisted-web] Cosmetic patch to nevow/freeform.py

Alex Levy twisted-web@twistedmatrix.com
Thu, 12 Feb 2004 12:35:21 -0500


--=-ZmpchNsZn8aTUgtN7S3L
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

This is insignificant, but helpful. Removes the description <div>
element when there is no description. Makes things look a little more
concise.

Index: nevow/freeform.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/Quotient/nevow/freeform.py,v
retrieving revision 1.108
diff -u -r1.108 freeform.py
--- nevow/freeform.py   11 Feb 2004 01:33:09 -0000      1.108
+++ nevow/freeform.py   12 Feb 2004 17:31:20 -0000
@@ -221,12 +221,14 @@
         if data.typedValue.getAttribute('compact'):
             return theslotfilled
=20
-        return [
+        ayb =3D [
             label(_class=3D"freeform-label")[ data.label ],
             theslotfilled, # freeform-input
             span(_class=3D"freeform-error")[ errormessage ],
-            div(_class=3D"freeform-description")[ data.description ],
         ]
+        if data.description:
+            ayb[div(_class=3D"freeform-description")[ data.description ]]
+        return ayb
=20
     def input(self, context, slot, data, name, value):
         raise NotImplementedError, "Implement in subclass"

--=20
Alex Levy
WWW: http://mesozoic.geecs.org

"Never let your sense of morals prevent you from doing what is right."
-- Salvor Hardin, Isaac Asimov's _Foundation_


--=-ZmpchNsZn8aTUgtN7S3L
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBAK7lYVM70CYlRlK4RAsSFAKDOikNIVgxl3cy23UgBkciktHWvhACdEURO
NkUW1US2J0qhvzRsvQTxoCU=
=0zRI
-----END PGP SIGNATURE-----

--=-ZmpchNsZn8aTUgtN7S3L--