Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
55106703
Commit
55106703
authored
Oct 29, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle list and tuple with the same branch in short_repr().
XXX thought I already checked this in.
parent
19a8ccc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/ZEO/zrpc/log.py
src/ZEO/zrpc/log.py
+6
-3
No files found.
src/ZEO/zrpc/log.py
View file @
55106703
...
@@ -45,7 +45,7 @@ def short_repr(obj):
...
@@ -45,7 +45,7 @@ def short_repr(obj):
# The pickle is near the beginning, too, and you can often fit the
# The pickle is near the beginning, too, and you can often fit the
# module name in the pickle.
# module name in the pickle.
if
isinstance
(
obj
,
types
.
StringType
):
if
isinstance
(
obj
,
str
):
if
len
(
obj
)
>
REPR_LIMIT
:
if
len
(
obj
)
>
REPR_LIMIT
:
r
=
repr
(
obj
[:
REPR_LIMIT
])
r
=
repr
(
obj
[:
REPR_LIMIT
])
else
:
else
:
...
@@ -53,7 +53,7 @@ def short_repr(obj):
...
@@ -53,7 +53,7 @@ def short_repr(obj):
if
len
(
r
)
>
REPR_LIMIT
:
if
len
(
r
)
>
REPR_LIMIT
:
r
=
r
[:
REPR_LIMIT
-
4
]
+
'...'
+
r
[
-
1
]
r
=
r
[:
REPR_LIMIT
-
4
]
+
'...'
+
r
[
-
1
]
return
r
return
r
elif
isinstance
(
obj
,
types
.
TupleType
):
elif
isinstance
(
obj
,
(
list
,
tuple
)
):
elts
=
[]
elts
=
[]
size
=
0
size
=
0
for
elt
in
obj
:
for
elt
in
obj
:
...
@@ -62,7 +62,10 @@ def short_repr(obj):
...
@@ -62,7 +62,10 @@ def short_repr(obj):
size
+=
len
(
r
)
size
+=
len
(
r
)
if
size
>
REPR_LIMIT
:
if
size
>
REPR_LIMIT
:
break
break
r
=
"(%s)"
%
(
", "
.
join
(
elts
))
if
isinstance
(
obj
,
tuple
):
r
=
"(%s)"
%
(
", "
.
join
(
elts
))
else
:
r
=
"[%s]"
%
(
", "
.
join
(
elts
))
else
:
else
:
r
=
repr
(
obj
)
r
=
repr
(
obj
)
if
len
(
r
)
>
REPR_LIMIT
:
if
len
(
r
)
>
REPR_LIMIT
:
...
...
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