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
87a05a38
Commit
87a05a38
authored
Dec 04, 1997
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sort
parent
b07285dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
lib/python/TreeDisplay/TreeTag.py
lib/python/TreeDisplay/TreeTag.py
+17
-3
No files found.
lib/python/TreeDisplay/TreeTag.py
View file @
87a05a38
...
...
@@ -9,8 +9,8 @@
# rights reserved.
#
############################################################################
__rcs_id__
=
'$Id: TreeTag.py,v 1.1
3 1997/12/03 21:56:29 jim
Exp $'
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
__rcs_id__
=
'$Id: TreeTag.py,v 1.1
4 1997/12/04 23:15:38 brian
Exp $'
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
from
DocumentTemplate.DT_Util
import
*
from
DocumentTemplate.DT_String
import
String
...
...
@@ -30,7 +30,7 @@ class Tree:
args
=
parse_params
(
args
,
name
=
None
,
expr
=
None
,
expand
=
None
,
leaves
=
None
,
header
=
None
,
footer
=
None
,
nowrap
=
1
,
branches
=
None
)
nowrap
=
1
,
branches
=
None
,
sort
=
None
)
has_key
=
args
.
has_key
if
has_key
(
'name'
):
name
=
args
[
'name'
]
...
...
@@ -173,6 +173,20 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
except
:
items
=
None
if
not
items
and
have_arg
(
'leaves'
):
items
=
1
if
(
args
.
has_key
(
'sort'
))
and
(
items
is
not
None
)
and
(
items
!=
1
):
# Faster/less mem in-place sort
sort
=
args
[
'sort'
]
size
=
range
(
len
(
items
))
for
i
in
size
:
v
=
items
[
i
]
k
=
getattr
(
v
,
sort
)
try
:
k
=
k
()
except
:
pass
items
[
i
]
=
(
k
,
v
)
items
.
sort
()
for
i
in
size
:
items
[
i
]
=
items
[
i
][
1
]
diff
.
append
(
id
)
if
substate
is
state
:
...
...
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