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
69f04b33
Commit
69f04b33
authored
Apr 09, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged FTP globbing/recursive patch
parent
b46e4902
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
3 deletions
+43
-3
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+43
-3
No files found.
lib/python/OFS/ObjectManager.py
View file @
69f04b33
...
...
@@ -84,9 +84,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.13
2 2001/04/03 15:25:14 brian
Exp $"""
$Id: ObjectManager.py,v 1.13
3 2001/04/09 19:31:27 andreas
Exp $"""
__version__
=
'$Revision: 1.13
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.13
3
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
Globals
,
CopySupport
,
Products
import
os
,
App
.
FactoryDispatcher
,
ts_regex
,
Products
...
...
@@ -102,7 +102,7 @@ import marshal
import
App.Common
from
AccessControl
import
getSecurityManager
from
zLOG
import
LOG
,
ERROR
import
sys
import
sys
,
string
,
fnmatch
,
copy
import
XMLExportImport
customImporters
=
{
...
...
@@ -595,6 +595,32 @@ class ObjectManager(
ob
=
ob
.
aq_parent
files
=
self
.
objectItems
()
# recursive ride through all subfolders (ls -R) (ajung)
if
REQUEST
.
environ
.
get
(
'FTP_RECURSIVE'
,
0
)
==
1
:
all_files
=
copy
.
copy
(
files
)
for
f
in
files
:
if
f
[
1
].
meta_type
==
"Folder"
:
all_files
.
extend
(
findChilds
(
f
[
1
]))
else
:
all_files
.
append
(
f
)
files
=
all_files
try
:
files
.
sort
()
except
AttributeError
:
files
=
list
(
files
)
files
.
sort
()
# Perform globbing on list of files (ajung)
globbing
=
REQUEST
.
environ
.
get
(
'GLOBBING'
,
''
)
if
globbing
is
not
None
:
files
=
filter
(
lambda
x
,
g
=
globbing
:
fnmatch
.
fnmatch
(
x
[
0
],
g
)
,
files
)
try
:
files
.
sort
()
except
AttributeError
:
...
...
@@ -650,4 +676,18 @@ class ObjectManager(
raise
KeyError
,
key
def
findChilds
(
obj
,
dirname
=
''
):
""" recursive walk through the object hierarcy to
find all childs of an object (ajung)
"""
lst
=
[]
for
name
,
child
in
obj
.
objectItems
():
if
child
.
meta_type
==
"Folder"
:
lst
.
extend
(
findChilds
(
child
,
dirname
+
obj
.
id
+
'/'
))
else
:
lst
.
append
(
(
dirname
+
obj
.
id
+
"/"
+
name
,
child
)
)
return
lst
Globals
.
default__class_init__
(
ObjectManager
)
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