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
2fa9f90a
Commit
2fa9f90a
authored
Mar 04, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
74d323b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+19
-16
lib/python/OFS/PropertySheets.py
lib/python/OFS/PropertySheets.py
+2
-2
No files found.
lib/python/OFS/ObjectManager.py
View file @
2fa9f90a
...
@@ -84,16 +84,17 @@
...
@@ -84,16 +84,17 @@
##############################################################################
##############################################################################
__doc__
=
"""Object Manager
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.5
1 1999/02/22 20:41:40 jim
Exp $"""
$Id: ObjectManager.py,v 1.5
2 1999/03/04 14:02:22 brian
Exp $"""
__version__
=
'$Revision: 1.5
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
2
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
App
.
Undo
,
Globals
import
App.Management
,
Acquisition
,
App
.
Undo
,
Globals
import
App.FactoryDispatcher
import
App.FactoryDispatcher
,
ts_regex
from
Globals
import
HTMLFile
,
HTMLFile
,
Persistent
from
Globals
import
HTMLFile
,
HTMLFile
,
Persistent
from
Globals
import
MessageDialog
,
default__class_init__
from
Globals
import
MessageDialog
,
default__class_init__
from
urllib
import
quote
from
urllib
import
quote
bad_id
=
ts_regex
.
compile
(
'[^a-zA-Z0-9-_~
\
,
\
. ]'
).
match
class
ObjectManager
(
class
ObjectManager
(
App
.
Management
.
Navigation
,
App
.
Management
.
Navigation
,
...
@@ -152,21 +153,23 @@ class ObjectManager(
...
@@ -152,21 +153,23 @@ class ObjectManager(
except
:
pass
except
:
pass
return
self
.
meta_types
+
self
.
dynamic_meta_types
+
pmt
return
self
.
meta_types
+
self
.
dynamic_meta_types
+
pmt
def
_checkId
(
self
,
id
):
def
_checkId
(
self
,
id
,
allow_dup
=
0
):
# If allow_dup is false, an error will be raised if an object
# with the given id already exists. If allow_dup is true,
# only check that the id string contains no illegal chars.
if
not
id
:
if
not
id
:
raise
'Bad Request'
,
'No <em>id</em> was specified'
raise
'Bad Request'
,
'No id was specified'
if
quote
(
id
)
!=
id
:
raise
'Bad Request'
,
(
if
bad_id
(
id
)
!=
-
1
:
"""The id <em>%s<em> is invalid - it
contains characters illegal in URLs."""
%
id
)
if
id
[:
1
]
==
'_'
:
raise
'Bad Request'
,
(
"""The id <em>%s<em> is invalid - it
begins with an underscore character, _."""
%
id
)
if
hasattr
(
self
,
'aq_base'
):
self
=
self
.
aq_base
if
hasattr
(
self
,
id
):
raise
'Bad Request'
,
(
raise
'Bad Request'
,
(
"""The id <em>%s<em> is invalid - it
'The id %s contains characters illegal in URLs.'
%
id
)
is already in use."""
%
id
)
if
id
[
0
]
==
'_'
:
raise
'Bad Request'
,
(
'The id %s is invalid - it begins with an underscore.'
%
id
)
if
not
allow_dup
:
if
hasattr
(
self
,
'aq_base'
):
self
=
self
.
aq_base
if
hasattr
(
self
,
id
):
raise
'Bad Request'
,
(
'The id %s is invalid - it is already in use.'
%
id
)
def
_checkObject
(
self
,
object
):
def
_checkObject
(
self
,
object
):
t
=
object
.
meta_type
t
=
object
.
meta_type
...
...
lib/python/OFS/PropertySheets.py
View file @
2fa9f90a
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
##############################################################################
##############################################################################
"""Property sheets"""
"""Property sheets"""
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
10
$'
[
11
:
-
2
]
import
time
,
string
,
App
.
Management
import
time
,
string
,
App
.
Management
from
ZPublisher.Converters
import
type_converters
from
ZPublisher.Converters
import
type_converters
...
@@ -286,7 +286,7 @@ class PropertySheet(Persistent, Implicit):
...
@@ -286,7 +286,7 @@ class PropertySheet(Persistent, Implicit):
if
ns
==
xml_id
:
if
ns
==
xml_id
:
if
not
propdict
.
has_key
(
name
):
if
not
propdict
.
has_key
(
name
):
prop
=
' <ps:%s/>'
%
name
prop
=
' <ps:%s/>'
%
name
emsg
=
errormsg
%
'
No such property
: %s'
%
name
emsg
=
errormsg
%
'
Property not found
: %s'
%
name
result
.
append
(
propstat
%
(
prop
,
'404 Not Found'
,
emsg
))
result
.
append
(
propstat
%
(
prop
,
'404 Not Found'
,
emsg
))
else
:
else
:
item
=
propdict
[
name
]
item
=
propdict
[
name
]
...
...
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