[Catalog-sig] Looking for help: Small PyPI change to fix setup.py register

Éric Araujo merwok at netwok.org
Wed Jul 14 09:36:19 CEST 2010


Hello catalog people

Over there on distutils-sig¹, someone pointed that using setup.py
register to create a new account did not work anymore. This was not
discovered before since most users probably already had an account or
used the Web page to create it. Remember that account creation has a
confirmation step that is always done via a Web page.

¹ http://mail.python.org/pipermail/distutils-sig/2010-July/016579.html

The reason that the Web interface still works and not the command-line
one is that now there is a small usage agreement to be read and
accepted, following advice from Van Lindbergh, the PSF lawyer. Greg
Ewing proposed to fix the setup.py register bug by moving the usage
agreement checkbox to the confirmation page. That way, every version of
distutils will work, and every registration (Web or command-line, any
version) will pass through the usage agreement. Van Lindbergh approved
the change.

Martin von Löwis asked for a patch. I grepped for strings seen on the
Web pages and URIs. If I had any METAL templates-fu, I’d try this way:

- remove the agreement text and checkbox from templates/register.pt

- add the agreement text and checkbox in a new form (with action
attribute set to /pypi and hidden input elements to get the URI
pypi?:action=user&otk=BLAH&agree=on) after line 2297 in webui/core.py
(or in a template or template block)

- move the test for the checkbox at lines 2355-2358 in webui/core.py
after line 2300 (with the right if blocks to check for 'otk' in
self.form and 'agree' in self.form)

I hope this can help someone write the patch.

Regards



More information about the Catalog-SIG mailing list