Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
8b0d7d2b
Commit
8b0d7d2b
authored
May 08, 2006
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
soem more cleanup
parent
8f709e6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+8
-11
No files found.
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
8b0d7d2b
...
@@ -10,35 +10,35 @@
...
@@ -10,35 +10,35 @@
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
"""Zope Page Template module (wrapper for the Zope 3 ZPT implementation)
""" Zope Page Template module (wrapper for the Zope 3 ZPT implementation) """
$Id$
"""
__version__
=
'$Revision: 1.48 $'
[
11
:
-
2
]
import
re
import
re
import
os
import
os
import
Acquisition
import
Acquisition
from
Globals
import
ImageFile
,
package_home
,
InitializeClass
from
Globals
import
ImageFile
,
package_home
,
InitializeClass
from
OFS.SimpleItem
import
SimpleItem
from
zope.contenttype
import
guess_content_type
from
DateTime.DateTime
import
DateTime
from
DateTime.DateTime
import
DateTime
from
Shared.DC.Scripts.Script
import
Script
from
Shared.DC.Scripts.Script
import
Script
from
Shared.DC.Scripts.Signature
import
FuncCode
from
Shared.DC.Scripts.Signature
import
FuncCode
from
OFS.SimpleItem
import
SimpleItem
from
OFS.History
import
Historical
,
html_diff
from
OFS.History
import
Historical
,
html_diff
from
OFS.Cache
import
Cacheable
from
OFS.Cache
import
Cacheable
from
OFS.Traversable
import
Traversable
from
OFS.Traversable
import
Traversable
from
OFS.PropertyManager
import
PropertyManager
from
OFS.PropertyManager
import
PropertyManager
from
AccessControl
import
getSecurityManager
,
safe_builtins
,
ClassSecurityInfo
from
AccessControl
import
getSecurityManager
,
safe_builtins
,
ClassSecurityInfo
from
AccessControl.Permissions
import
view
,
ftp_access
,
change_page_templates
,
view_management_screens
from
AccessControl.Permissions
import
view
,
ftp_access
,
change_page_templates
from
AccessControl.Permissions
import
view_management_screens
from
webdav.Lockable
import
ResourceLockedError
from
webdav.Lockable
import
ResourceLockedError
from
webdav.WriteLockInterface
import
WriteLockInterface
from
webdav.WriteLockInterface
import
WriteLockInterface
from
zope.contenttype
import
guess_content_type
from
zope.pagetemplate.pagetemplate
import
PageTemplate
from
zope.pagetemplate.pagetemplate
import
PageTemplate
from
zope.pagetemplate.pagetemplatefile
import
sniff_type
from
zope.pagetemplate.pagetemplatefile
import
sniff_type
from
Engine
import
Engine
from
Products.PageTemplates.
Engine
import
Engine
# regular expression to extract the encoding from the XML preamble
# regular expression to extract the encoding from the XML preamble
...
@@ -75,7 +75,6 @@ class Src(Acquisition.Explicit):
...
@@ -75,7 +75,6 @@ class Src(Acquisition.Explicit):
def sniffEncoding(text, default_encoding='
utf
-
8
'):
def sniffEncoding(text, default_encoding='
utf
-
8
'):
""" try to determine the encoding from html or xml """
""" try to determine the encoding from html or xml """
if text.startswith('
<
?
xml
'):
if text.startswith('
<
?
xml
'):
mo = encoding_reg.search(text)
mo = encoding_reg.search(text)
if mo:
if mo:
...
@@ -84,14 +83,12 @@ def sniffEncoding(text, default_encoding='utf-8'):
...
@@ -84,14 +83,12 @@ def sniffEncoding(text, default_encoding='utf-8'):
def guess_type(filename, text):
def guess_type(filename, text):
content_type, dummy = guess_content_type(filename, text)
content_type, dummy = guess_content_type(filename, text)
if content_type in ('
text
/
html
', '
text
/
xml
'):
if content_type in ('
text
/
html
', '
text
/
xml
'):
return content_type
return content_type
return sniff_type(text) or '
text
/
html
'
return sniff_type(text) or '
text
/
html
'
_default_content_fn = os.path.join(package_home(globals()), '
pt
', '
default
.
html
')
_default_content_fn = os.path.join(package_home(globals()), '
pt
', '
default
.
html
')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment