Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coolamqp
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
coolamqp
Commits
c2ef2b0c
Commit
c2ef2b0c
authored
7 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
check this
parent
0ef6d5d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
coolamqp/framing/compilation/content_property.py
+10
-7
10 additions, 7 deletions
coolamqp/framing/compilation/content_property.py
with
10 additions
and
7 deletions
coolamqp/framing/compilation/content_property.py
+
10
−
7
View file @
c2ef2b0c
...
...
@@ -21,7 +21,8 @@ def _compile_particular_content_property_list_class(zpf, fields):
from
coolamqp.framing.compilation.utilities
import
format_field_name
if
any
(
field
.
basic_type
==
'
bit
'
for
field
in
fields
):
return
u
"
raise NotImplementedError(
'
I don
'
t support bits in properties yet
'
)
"
NB
=
u
"
raise NotImplementedError(
'
I don
'
t support bits in properties
'
)
"
return
NB
# Convert ZPF to a list of [if_exists::bool]
even
=
True
...
...
@@ -33,11 +34,13 @@ def _compile_particular_content_property_list_class(zpf, fields):
if
not
even
:
p
=
p
[:
7
]
zpf_bits
.
extend
(
map
(
lambda
x
:
bool
(
int
(
x
)),
p
))
for
x
in
p
:
zpf_bits
.
append
(
bool
(
int
(
x
)))
zpf_length
=
len
(
zpf
)
# 1 here does not mean that field is present. All bit fields are present, but 0 in a ZPF. Fix this.
# 1 here does not mean that field is present. All bit fields are present,
# but 0 in a ZPF. Fix this.
zpf_bits
=
[
zpf_bit
or
field
.
type
==
'
bit
'
for
zpf_bit
,
field
in
zip
(
zpf_bits
,
fields
)]
...
...
@@ -83,10 +86,12 @@ class ParticularContentTypeList(AMQPContentPropertyList):
ZERO_PROPERTY_FLAGS = %s
'''
%
(
x
,))
FFN
=
u
'
,
'
.
join
(
format_field_name
(
field
.
name
)
for
field
in
present_fields
)
if
len
(
present_fields
)
>
0
:
mod
.
append
(
u
'''
def __init__(self, %s):
'''
%
(
u
'
,
'
.
join
(
format_field_name
(
field
.
name
)
for
field
in
present_fields
)
))
'''
%
(
FFN
,
))
for
field
in
present_fields
:
mod
.
append
(
u
'
self.%s = %s
\n
'
.
replace
(
u
'
%s
'
,
format_field_name
(
...
...
@@ -112,9 +117,7 @@ class ParticularContentTypeList(AMQPContentPropertyList):
mod
.
append
(
get_from_buffer
(
present_fields
,
prefix
=
''
,
indent_level
=
2
))
mod
.
append
(
u
'
return cls(%s)
\n
'
%
u
'
,
'
.
join
(
format_field_name
(
field
.
name
)
for
field
in
present_fields
))
mod
.
append
(
u
'
return cls(%s)
\n
'
%
(
FFN
,
))
# get_size
mod
.
append
(
u
'
\n
def get_size(self):
\n
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment