[Catalog-sig] Tab Title customization and Tal to Django/Jinja transition

anatoly techtonik techtonik at gmail.com
Thu Jun 30 18:43:10 CEST 2011

On Thu, Jun 30, 2011 at 12:54 AM, Chris Withers <chris at simplistix.co.uk> wrote:
>>> On 29/06/2011 19:57, anatoly techtonik wrote:
>>>> 1. more users are familiar with Django templates than with TAL
>>> That an interesting and probably incorrect assertion.
>> Some proof from my side.
>> http://www.google.com/trends?q=%22tal+templates%22%2C+%22django+templates%22
>> Your turn.
> Pointless posturing.
> Google trends don't provide a way to accurately compare the usage of two
> templating languages. The whole Plone community uses TAL, not to mention the
> rest of the Zope world, all the people who use chameleon or one of the other
> python TAL implementations, not to mention the TAL implementations in other
> languages such as Java and PHP.

I don't know the size of these communities. Never tried to use Plone.
I guess that's because it is GPL, and the only site I know that uses
it is stackless.com, which is in a rather poor condition. Zope doesn't
sounds good if pronounced in Russian, but I guess the license
limitation (obligatory doc writing) was a primary concern too.

>>>> 4. Django templates seems way more simple and no less powerful
>>> That's just plain wrong.
>> Ok. Then answer the original question. How to override html title
>> attribute for a subset of PyPI pages?
> The root template is likely a macro template, if it hasn't been designed to
> allow customising on a per-page basis, you'd need to modify it:
> <title metal:define-slot="title"...
> Then in the specific template, fill that slot:
> <title metal:fill-slot="title"...

Thanks. It doesn't seem right to include <title> tag in display.pt
that doesn't have head section at all, so I've inserted

<metal:fill fill-slot="title"...

Will the new patch work ok? (attached)

>> Ok. Personal question then - do you support moving PyPI to App Engine?
> Absolutely not.
>> Do you support moving PyPI to other cloud platform?
> +0.
> I'm in favour of mirrors, how those mirrors are implemented I don't really
> care, as long as the http api they expose is consistent and, more
> importantly, provided the tools around (ie: setuptools) use them.
> If that last issue isn't solved, mirrors are cute and maybe useful in
> emergencies where you're prepared to go and manually download packages, but
> otherwise they're essentially useless.

Sounds reasonable. But increased availability, security and DoS
protection with mirrors is gained at a cost of administration hassle,
and server stuff is something nobody wants to deal with, because these
problems are truly endless.
anatoly t.
-------------- next part --------------
Index: pypi/templates/display.pt
--- pypi/templates/display.pt	(revision 925)
+++ pypi/templates/display.pt	(working copy)
@@ -4,6 +4,8 @@
+<metal:fill fill-slot="title" tal:content="string:${data/name} ${data/version}: Python Package Index" />
 <metal:fill fill-slot="head">
  <meta tal:condition="data/release/keywords | nothing"
Index: pypi/templates/standard_template.pt
--- pypi/templates/standard_template.pt	(revision 925)
+++ pypi/templates/standard_template.pt	(working copy)
@@ -8,7 +8,7 @@
       <META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW" tal:condition="data/norobots"/>
       <meta content="text/html; charset=utf-8" http-equiv="content-type" />
       <base tal:attributes="href data/FULL_PATH_INFO"/>
-      <title tal:content="string:Python Package Index : ${data/title}" />
+      <title metal:define-slot="title" tal:content="Python Package Index : string:${data/title}" />
       <meta tal:attributes="content data/keywords" />
       <meta tal:attributes="content data/description" />
        <link rel="alternate" type="application/rss+xml" title="RSS: 30 latest updates" href="http://www.python.org/pypi?:action=rss"/>
Index: pypi/webui.py
--- pypi/webui.py	(revision 925)
+++ pypi/webui.py	(working copy)
@@ -1348,7 +1348,6 @@
                             name=name, version=version, release=release,
                             description=release.get('summary') or name,
                             keywords=release.get('keywords', ''),
-                            title=name + " " +version,

More information about the Catalog-SIG mailing list