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
ea10a300
Commit
ea10a300
authored
Mar 07, 2009
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract _getImportPaths method.
parent
ca01cd0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/OFS/ObjectManager.py
src/OFS/ObjectManager.py
+7
-4
No files found.
src/OFS/ObjectManager.py
View file @
ea10a300
...
@@ -618,7 +618,7 @@ class ObjectManager(CopyContainer,
...
@@ -618,7 +618,7 @@ class ObjectManager(CopyContainer,
raise
BadRequest
,
'Invalid file name %s'
%
escape
(
file
)
raise
BadRequest
,
'Invalid file name %s'
%
escape
(
file
)
cfg
=
getConfiguration
()
cfg
=
getConfiguration
()
for
impath
in
(
cfg
.
instancehome
,
getattr
(
cfg
,
'zopehome'
,
''
)
):
for
impath
in
self
.
_getImportPaths
(
):
filepath
=
os
.
path
.
join
(
impath
,
'import'
,
file
)
filepath
=
os
.
path
.
join
(
impath
,
'import'
,
file
)
if
os
.
path
.
exists
(
filepath
):
if
os
.
path
.
exists
(
filepath
):
break
break
...
@@ -655,8 +655,7 @@ class ObjectManager(CopyContainer,
...
@@ -655,8 +655,7 @@ class ObjectManager(CopyContainer,
ob
=
self
.
_getOb
(
id
)
ob
=
self
.
_getOb
(
id
)
ob
.
manage_changeOwnershipType
(
explicit
=
0
)
ob
.
manage_changeOwnershipType
(
explicit
=
0
)
def
list_imports
(
self
):
def
_getImportPaths
(
self
):
listing
=
[]
cfg
=
getConfiguration
()
cfg
=
getConfiguration
()
paths
=
[]
paths
=
[]
zopehome
=
getattr
(
cfg
,
'zopehome'
,
None
)
zopehome
=
getattr
(
cfg
,
'zopehome'
,
None
)
...
@@ -664,7 +663,11 @@ class ObjectManager(CopyContainer,
...
@@ -664,7 +663,11 @@ class ObjectManager(CopyContainer,
paths
.
append
(
zopehome
)
paths
.
append
(
zopehome
)
if
not
cfg
.
instancehome
in
paths
:
if
not
cfg
.
instancehome
in
paths
:
paths
.
append
(
cfg
.
instancehome
)
paths
.
append
(
cfg
.
instancehome
)
for
impath
in
paths
:
return
paths
def
list_imports
(
self
):
listing
=
[]
for
impath
in
self
.
_getImportPaths
():
directory
=
os
.
path
.
join
(
impath
,
'import'
)
directory
=
os
.
path
.
join
(
impath
,
'import'
)
if
not
os
.
path
.
isdir
(
directory
):
if
not
os
.
path
.
isdir
(
directory
):
continue
continue
...
...
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