Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
54740503
Commit
54740503
authored
Nov 17, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified TransactionMetaData and added a deprecation warning for _extension
parent
14613505
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
29 deletions
+14
-29
src/ZODB/Connection.py
src/ZODB/Connection.py
+14
-29
No files found.
src/ZODB/Connection.py
View file @
54740503
...
@@ -1289,31 +1289,17 @@ size.
...
@@ -1289,31 +1289,17 @@ size.
class
TransactionMetaData
(
object
):
class
TransactionMetaData
(
object
):
def
__init__
(
self
,
user
=
u''
,
description
=
u''
,
extension
=
b''
):
def
__init__
(
self
,
user
=
u''
,
description
=
u''
,
extension
=
b''
):
self
.
user
=
user
self
.
description
=
description
if
not
isinstance
(
extension
,
dict
):
extension
=
_compat
.
loads
(
extension
)
if
extension
else
{}
self
.
extension
=
extension
@
property
def
user
(
self
):
return
self
.
__user
@
user
.
setter
def
user
(
self
,
user
):
if
not
isinstance
(
user
,
bytes
):
if
not
isinstance
(
user
,
bytes
):
user
=
user
.
encode
(
'utf-8'
)
user
=
user
.
encode
(
'utf-8'
)
self
.
__user
=
user
self
.
user
=
user
@
property
def
description
(
self
):
return
self
.
__description
@
description
.
setter
def
description
(
self
,
description
):
if
not
isinstance
(
description
,
bytes
):
if
not
isinstance
(
description
,
bytes
):
description
=
description
.
encode
(
'utf-8'
)
description
=
description
.
encode
(
'utf-8'
)
self
.
__description
=
description
self
.
description
=
description
if
not
isinstance
(
extension
,
dict
):
extension
=
_compat
.
loads
(
extension
)
if
extension
else
{}
self
.
extension
=
extension
def
note
(
self
,
text
):
# for tests
def
note
(
self
,
text
):
# for tests
text
=
text
.
strip
()
text
=
text
.
strip
()
...
@@ -1324,13 +1310,12 @@ class TransactionMetaData(object):
...
@@ -1324,13 +1310,12 @@ class TransactionMetaData(object):
else
:
else
:
self
.
description
=
text
self
.
description
=
text
@
property
@
property
def
extension
(
self
):
def
_
extension
(
self
):
return
self
.
__extension
warnings
.
warn
(
"_extension is deprecated, use extension"
,
DeprecationWarning
)
@
extension
.
setter
return
self
.
extension
def
extension
(
self
,
v
):
self
.
__extension
=
v
@
_extension
.
setter
def
_extension
(
self
,
v
):
_extension
=
extension
self
.
extension
=
v
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