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
1b3fb5bb
Commit
1b3fb5bb
authored
Dec 12, 2005
by
Paul Winkler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed OFS.ObjectManager list_import() to tolerate missing directories.
parent
81f1124f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+2
-0
lib/python/OFS/tests/testObjectManager.py
lib/python/OFS/tests/testObjectManager.py
+10
-1
No files found.
doc/CHANGES.txt
View file @
1b3fb5bb
...
@@ -115,6 +115,9 @@ Zope Changes
...
@@ -115,6 +115,9 @@ Zope Changes
Bugs Fixed
Bugs Fixed
- OFS ObjectManager: Fixed list_imports() to tolerate missing
import directories.
- Collector #1621, 1894: Removed support for use of long-deprecated
- Collector #1621, 1894: Removed support for use of long-deprecated
'whrandom' module.
'whrandom' module.
...
...
lib/python/OFS/ObjectManager.py
View file @
1b3fb5bb
...
@@ -625,6 +625,8 @@ class ObjectManager(
...
@@ -625,6 +625,8 @@ class ObjectManager(
paths
.
append
(
cfg
.
instancehome
)
paths
.
append
(
cfg
.
instancehome
)
for
impath
in
paths
:
for
impath
in
paths
:
directory
=
os
.
path
.
join
(
impath
,
'import'
)
directory
=
os
.
path
.
join
(
impath
,
'import'
)
if
not
os
.
path
.
isdir
(
directory
):
continue
listing
+=
[
f
for
f
in
os
.
listdir
(
directory
)
listing
+=
[
f
for
f
in
os
.
listdir
(
directory
)
if
f
.
endswith
(
'.zexp'
)
or
f
.
endswith
(
'.xml'
)]
if
f
.
endswith
(
'.zexp'
)
or
f
.
endswith
(
'.xml'
)]
return
listing
return
listing
...
...
lib/python/OFS/tests/testObjectManager.py
View file @
1b3fb5bb
...
@@ -108,7 +108,6 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
...
@@ -108,7 +108,6 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
self
.
assertEqual
(
si
.
__ac_local_roles__
,
None
)
self
.
assertEqual
(
si
.
__ac_local_roles__
,
None
)
def
test_setObject_set_owner_with_emergency_user
(
self
):
def
test_setObject_set_owner_with_emergency_user
(
self
):
om
=
self
.
_makeOne
()
om
=
self
.
_makeOne
()
newSecurityManager
(
None
,
emergency_user
)
newSecurityManager
(
None
,
emergency_user
)
...
@@ -380,6 +379,16 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
...
@@ -380,6 +379,16 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'REQUEST'
,
si
)
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'REQUEST'
,
si
)
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'/'
,
si
)
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'/'
,
si
)
def
test_list_imports
(
self
):
om
=
self
.
_makeOne
()
# This must work whether we've done "make instance" or not.
# So list_imports() may return an empty list, or whatever's
# in skel/import. Tolerate both cases.
self
.
failUnless
(
isinstance
(
om
.
list_imports
(),
list
))
for
filename
in
om
.
list_imports
():
self
.
failUnless
(
filename
.
endswith
(
'.zexp'
)
or
filename
.
endswith
(
'.xml'
))
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
ObjectManagerTests
)
)
suite
.
addTest
(
unittest
.
makeSuite
(
ObjectManagerTests
)
)
...
...
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