[Zope-dev] zope.mimetype dependency on zope.publisher
sean.upton at uniontrib.com
sean.upton at uniontrib.com
Thu Feb 21 15:10:45 EST 2008
Fred Drake wrote:
> zope.contenttype is a copy/hack of an older version of the mimetypes
module
> from Python's standard library. I'm not sure it's a *good* place to
put
> the functions, but it's probably better than zope.publisher.
zope.contenttype has only standard library dependencies, which is an
improvement for me. This functionality is thematically related, if
nothing else.
> zope.publisher.contenttype would need to remain for compatibility, but
> should be able to simply import the functions from zope.contenttype.
I experimented (diff attached) by moving contenttype.py to
zope.contenttype.mimeparser, then copying tests; with minor
search/replace in the copy of tests, this works. If these can be moved,
it seems much better to make zope.contenttype a documented dependency of
zope.mimetype and change the imports in zope.mimetype to cease importing
from zope.publisher.
> I'll suggest the just copying the implementation module to
> zope.contenttype.parser. :-) There are tests that will need to be
copied
> as well.
Renaming that module to be more descriptive too might be good when it is
copied. See attached diff to trunk r79689 (for which tests pass) for
what I'm thinking.
Thanks,
Sean
+----------------------------------------------------------+
Sean Upton The San Diego Union-Tribune
619.293.1451 Systems Applications Supervisor - Newsroom
Information Technology
350 Camino De La Reina
San Diego, CA 92108 sean.upton at uniontrib.com
+----------------------------------------------------------+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zope.contenttype.diff
Type: application/octet-stream
Size: 13404 bytes
Desc: zope.contenttype.diff
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20080221/634e77d2/zope.contenttype.obj
More information about the Zope-Dev
mailing list