This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Adapters

Default Display Name Generator

The default display name generator simply takes a Dublin Core title or a __name__ and returns it, truncated if desired. It uses a helper function intended to make writing other display name generators easier, convertName.

No help is offered yet for using HTML with the IBrowserDisplayNameGenerator interface.

Given an ILocation that can be adapted to zope.dublincore.interfaces.IDCDescriptiveProperties, and that actually has a value for it, it returns the DC title; otherwise, it uses __name__.

>>> import zope.dublincore.interfaces
>>> import zope.location.interfaces
>>> from zc.displayname import interfaces, adapters
>>> from zope.interface import verify
>>> from zope import interface
>>> class Dummy(object):
...     interface.implements(zope.location.interfaces.ILocation)
...     def __init__(self, parent, name):
...         self.__parent__ = parent
...         self.__name__ = name
...
>>> d = Dummy('parent', 'a name')
>>> from zope.publisher.browser import TestRequest
>>> g = adapters.DefaultDisplayNameGenerator(d, TestRequest())
>>> verify.verifyObject(interfaces.IDisplayNameGenerator, g)
True
>>> g()
'a name'
>>> g('foo')
Traceback (most recent call last):
...
TypeError: ('maxlength must be int', 'foo')
>>> g(-1)
Traceback (most recent call last):
...
ValueError: ('maxlength must be 0 or greater', -1)
>>> g(4)
'a...'
>>> g(6)
'a name'
>>> g(2)
'??'
>>> interface.directlyProvides(
...     d, zope.dublincore.interfaces.IDCDescriptiveProperties)
>>> d.title = 'My Special Dummy'
>>> d.description = 'My interface said I had to have this'
>>> verify.verifyObject(
...     zope.dublincore.interfaces.IDCDescriptiveProperties, d)
True
>>> g()
'My Special Dummy'
>>> g(0)
''
>>> g(100)
'My Special Dummy'
>>> g(16)
'My Special Dummy'
>>> g(15)
'My Special D...'
Release History

Release History

1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
zc.displayname-1.1.tar.gz (8.4 kB) Copy SHA256 Checksum SHA256 Source Feb 25, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting