Skip to content

Commit

Permalink
- simplifying the solution
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed May 18, 2024
1 parent 08cf823 commit d8aaff7
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ additional-rules = [
"recursive-include src *.svg",
"recursive-include src *.ttf",
"recursive-include src *.txt",
"recursive-include src *.types",
"recursive-include src *.webmanifest",
"recursive-include src *.woff",
"recursive-include src *.woff2",
Expand Down
3 changes: 1 addition & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst
5.9.1 (unreleased)
------------------

- Define a custom MIME type for Zope Page Templates
instead of relying on platform-dependent MIME type configurations.
- Recognize Page Templates by file extension for WebDAV.
(`#1212 <https://github.com/zopefoundation/Zope/issues/1212>`_)

- Clean up and fix installation documentation.
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ recursive-include src *.rst
recursive-include src *.svg
recursive-include src *.ttf
recursive-include src *.txt
recursive-include src *.types
recursive-include src *.webmanifest
recursive-include src *.woff
recursive-include src *.woff2
Expand Down
9 changes: 0 additions & 9 deletions src/Products/PageTemplates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
This wrapper allows the Page Template modules to be segregated in a
separate package.
"""
import os

from zope.contenttype import add_files


# Placeholder for Zope Product data
misc_ = {}
Expand All @@ -33,8 +29,3 @@ def initialize(context):
# Import lazily, and defer initialization to the module
from . import ZopePageTemplate
ZopePageTemplate.initialize(context)

# Add the custom MIME type information for Page Templates
# to the Python mimetypes module so they are recognized correctly
here = os.path.dirname(os.path.abspath(__file__))
add_files([os.path.join(here, 'mime.types')])
1 change: 0 additions & 1 deletion src/Products/PageTemplates/mime.types

This file was deleted.

4 changes: 1 addition & 3 deletions src/webdav/NullResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ def _default_PUT_factory(self, name, typ, body):

if ext == '.dtml':
ob = DTMLDocument('', __name__=name)
elif typ in ('text/html',
'text/xml',
'application/vnd.zopefoundation.pagetemplate'):
elif ext in ('.pt', '.zpt') or typ in ('text/html', 'text/xml'):
ob = ZopePageTemplate(name, body, content_type=typ)
elif typ.startswith('image/'):
ob = Image(name, '', body, content_type=typ)
Expand Down

0 comments on commit d8aaff7

Please sign in to comment.