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
5fb69afb
Commit
5fb69afb
authored
Dec 15, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make folder listings for FTP include "." as well as "..".
parent
e443a708
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+13
-8
No files found.
doc/CHANGES.txt
View file @
5fb69afb
...
...
@@ -24,6 +24,8 @@ Zope Changes
Features added
- Folder listings in FTP now include "." as well as "..".
- When a VHM is activated, it adds the mapping
'VIRTUAL_URL_PARTS': (SERVER_URL, BASEPATH1, virtual_url_path)
to the request's 'other' dictionary. If BASEPATH1 is empty, it
...
...
lib/python/OFS/ObjectManager.py
View file @
5fb69afb
...
...
@@ -12,9 +12,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.16
6 2003/11/28 16:45:35 jim
Exp $"""
$Id: ObjectManager.py,v 1.16
7 2003/12/15 22:09:25 fdrake
Exp $"""
__version__
=
'$Revision: 1.16
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.16
7
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
Globals
,
CopySupport
,
Products
import
os
,
App
.
FactoryDispatcher
,
re
,
Products
...
...
@@ -592,7 +592,7 @@ class ObjectManager(
all_files
=
copy
.
copy
(
files
)
for
f
in
files
:
if
f
[
1
].
meta_type
==
"Folder"
:
all_files
.
extend
(
findChild
s
(
f
[
1
]))
all_files
.
extend
(
findChild
ren
(
f
[
1
]))
else
:
all_files
.
append
(
f
)
...
...
@@ -608,7 +608,7 @@ class ObjectManager(
globbing
=
REQUEST
.
environ
.
get
(
'GLOBBING'
,
''
)
if
globbing
:
files
=
filter
(
lambda
x
,
g
=
globbing
:
fnmatch
.
fnmatch
(
x
[
0
],
g
)
,
files
)
files
=
filter
(
lambda
x
,
g
=
globbing
:
fnmatch
.
fnmatch
(
x
[
0
],
g
),
files
)
try
:
files
.
sort
()
...
...
@@ -619,12 +619,17 @@ class ObjectManager(
if
not
(
hasattr
(
self
,
'isTopLevelPrincipiaApplicationObject'
)
and
self
.
isTopLevelPrincipiaApplicationObject
):
files
.
insert
(
0
,(
'..'
,
self
.
aq_parent
))
files
.
insert
(
0
,
(
'.'
,
self
))
for
k
,
v
in
files
:
# Note that we have to tolerate failure here, because
# Broken objects won't stat correctly. If an object fails
# to be able to stat itself, we will ignore it.
try
:
stat
=
marshal
.
loads
(
v
.
manage_FTPstat
(
REQUEST
))
except
:
stat
=
None
except
:
stat
=
None
if
k
!=
"Control_Panel"
:
__traceback_info__
=
(
k
,
v
)
raise
if
stat
is
not
None
:
out
=
out
+
((
k
,
stat
),)
return
marshal
.
dumps
(
out
)
...
...
@@ -667,15 +672,15 @@ class ObjectManager(
return
NullResource
(
self
,
key
,
request
).
__of__
(
self
)
raise
KeyError
,
key
def
findChild
s
(
obj
,
dirname
=
''
):
def
findChild
ren
(
obj
,
dirname
=
''
):
""" recursive walk through the object hierarchy to
find all child
s
of an object (ajung)
find all child
ren
of an object (ajung)
"""
lst
=
[]
for
name
,
child
in
obj
.
objectItems
():
if
child
.
meta_type
==
"Folder"
:
lst
.
extend
(
findChild
s
(
child
,
dirname
+
obj
.
id
+
'/'
))
lst
.
extend
(
findChild
ren
(
child
,
dirname
+
obj
.
id
+
'/'
))
else
:
lst
.
append
(
(
dirname
+
obj
.
id
+
"/"
+
name
,
child
)
)
...
...
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