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
a4aecadd
Commit
a4aecadd
authored
Dec 13, 2005
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deprecated OFS.content_types
parent
1b3fb5bb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
12 deletions
+24
-12
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/App/ImageFile.py
lib/python/App/ImageFile.py
+4
-3
lib/python/OFS/DTMLDocument.py
lib/python/OFS/DTMLDocument.py
+1
-1
lib/python/OFS/DTMLMethod.py
lib/python/OFS/DTMLMethod.py
+1
-1
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+1
-1
lib/python/OFS/content_types.py
lib/python/OFS/content_types.py
+6
-0
lib/python/ZClasses/Method.py
lib/python/ZClasses/Method.py
+2
-2
lib/python/webdav/NullResource.py
lib/python/webdav/NullResource.py
+6
-4
No files found.
doc/CHANGES.txt
View file @
a4aecadd
...
...
@@ -26,6 +26,9 @@ Zope Changes
Features added
- deprecated OFS.content_types (to be removed in Zope 2.11) and
replaced all occurences with zope.app.content_types
- OFS.content_types: moved code to zope.app.content_types and added
method aliases
...
...
lib/python/App/ImageFile.py
View file @
a4aecadd
...
...
@@ -17,15 +17,16 @@ __version__='$Revision: 1.20 $'[11:-2]
import
os
import
time
import
Acquisition
import
Globals
from
Globals
import
InitializeClass
from
AccessControl
import
ClassSecurityInfo
from
App.config
import
getConfiguration
from
OFS.content_types
import
guess_content_type
from
Globals
import
package_home
from
Common
import
rfc1123_date
from
DateTime
import
DateTime
import
Acquisition
import
Globals
from
zope.app.content_types
import
guess_content_type
class
ImageFile
(
Acquisition
.
Explicit
):
"""Image objects stored in external files."""
...
...
lib/python/OFS/DTMLDocument.py
View file @
a4aecadd
...
...
@@ -17,7 +17,7 @@ $Id$
from
Globals
import
InitializeClass
from
ZPublisher.Converters
import
type_converters
from
Globals
import
HTML
,
DTMLFile
,
MessageDialog
from
OFS
.content_types
import
guess_content_type
from
zope.app
.content_types
import
guess_content_type
from
DTMLMethod
import
DTMLMethod
,
decapitate
from
PropertyManager
import
PropertyManager
from
webdav.common
import
rfc1123_date
...
...
lib/python/OFS/DTMLMethod.py
View file @
a4aecadd
...
...
@@ -18,7 +18,7 @@ import History
from
Globals
import
HTML
,
DTMLFile
,
MessageDialog
from
Globals
import
InitializeClass
from
SimpleItem
import
Item_w__name__
,
pretty_tb
from
OFS
.content_types
import
guess_content_type
from
zope.app
.content_types
import
guess_content_type
from
PropertyManager
import
PropertyManager
from
AccessControl
import
ClassSecurityInfo
from
AccessControl.Role
import
RoleManager
...
...
lib/python/OFS/Image.py
View file @
a4aecadd
...
...
@@ -15,7 +15,7 @@
$Id$
"""
import
struct
from
OFS
.content_types
import
guess_content_type
from
zope.app
.content_types
import
guess_content_type
from
Globals
import
DTMLFile
from
Globals
import
InitializeClass
from
PropertyManager
import
PropertyManager
...
...
lib/python/OFS/content_types.py
View file @
a4aecadd
...
...
@@ -15,4 +15,10 @@
$Id$
"""
import
warnings
warnings
.
warn
(
'Using OFS.content_types is deprecated (will be removed in Zope '
'2.11). Instead use zope.app.content_types.'
,
DeprecationWarning
,
stacklevel
=
2
)
from
zope.app.content_types
import
text_type
,
guess_content_type
,
add_files
lib/python/ZClasses/Method.py
View file @
a4aecadd
...
...
@@ -19,13 +19,13 @@ import App.Dialogs, ZClasses, App.Factory, App.ProductRegistry
import
ZClassOwner
from
AccessControl.PermissionMapping
import
aqwrap
,
PermissionMapper
import
OFS.content_types
from
OFS.DTMLMethod
import
DTMLMethod
from
Products.PythonScripts.PythonScript
import
PythonScript
from
zExceptions
import
BadRequest
import
marshal
from
cgi
import
escape
from
zope.app.content_types
import
guess_content_type
_marker
=
[]
class
ZClassMethodsSheet
(
...
...
@@ -189,7 +189,7 @@ class ZClassMethodsSheet(
new item uploaded via FTP/WebDAV.
"""
if
typ
is
None
:
typ
,
enc
=
OFS
.
content_types
.
guess_content_type
()
typ
,
enc
=
guess_content_type
()
if
typ
==
'text/x-python'
:
return
PythonScript
(
name
)
if
typ
[
:
4
]
==
'text'
:
...
...
lib/python/webdav/NullResource.py
View file @
a4aecadd
...
...
@@ -17,9 +17,9 @@ $Id$
import
sys
import
Acquisition
,
OFS
.
content_types
from
Globals
import
InitializeClass
import
Acquisition
import
OFS.SimpleItem
from
Globals
import
InitializeClass
from
AccessControl
import
getSecurityManager
from
AccessControl
import
ClassSecurityInfo
from
AccessControl.Permissions
import
view
as
View
...
...
@@ -39,6 +39,8 @@ from interfaces import IWriteLock
from
Resource
import
Resource
from
WriteLockInterface
import
WriteLockInterface
from
zope.app.content_types
import
guess_content_type
class
NullResource
(
Persistent
,
Acquisition
.
Implicit
,
Resource
):
...
...
@@ -143,7 +145,7 @@ class NullResource(Persistent, Acquisition.Implicit, Resource):
typ
=
REQUEST
.
get_header
(
'content-type'
,
None
)
if
typ
is
None
:
typ
,
enc
=
OFS
.
content_types
.
guess_content_type
(
name
,
body
)
typ
,
enc
=
guess_content_type
(
name
,
body
)
factory
=
getattr
(
parent
,
'PUT_factory'
,
self
.
_default_PUT_factory
)
ob
=
factory
(
name
,
typ
,
body
)
...
...
@@ -409,7 +411,7 @@ class LockNullResource(NullResource, OFS.SimpleItem.Item_w__name__):
body
=
REQUEST
.
get
(
'BODY'
,
''
)
typ
=
REQUEST
.
get_header
(
'content-type'
,
None
)
if
typ
is
None
:
typ
,
enc
=
OFS
.
content_types
.
guess_content_type
(
name
,
body
)
typ
,
enc
=
guess_content_type
(
name
,
body
)
factory
=
getattr
(
parent
,
'PUT_factory'
,
self
.
_default_PUT_factory
)
ob
=
(
factory
(
name
,
typ
,
body
)
or
...
...
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