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
25508dba
Commit
25508dba
authored
7 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
slow improve
parent
0703ab2d
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/utilities.py
+10
-6
10 additions, 6 deletions
coolamqp/framing/compilation/utilities.py
with
10 additions
and
6 deletions
coolamqp/framing/compilation/utilities.py
+
10
−
6
View file @
25508dba
...
@@ -36,8 +36,7 @@ class Method(object):
...
@@ -36,8 +36,7 @@ class Method(object):
self
.
docs
=
docs
self
.
docs
=
docs
self
.
sent_by_client
=
sent_by_client
self
.
sent_by_client
=
sent_by_client
self
.
sent_by_server
=
sent_by_server
self
.
sent_by_server
=
sent_by_server
self
.
constant
=
all
(
f
.
reserved
for
f
in
self
.
fields
)
self
.
constant
=
len
([
f
for
f
in
self
.
fields
if
not
f
.
reserved
])
==
0
def
get_static_body
(
self
):
# only arguments part
def
get_static_body
(
self
):
# only arguments part
body
=
[]
body
=
[]
...
@@ -115,12 +114,13 @@ def for_field(elem): # for <field> in <method>
...
@@ -115,12 +114,13 @@ def for_field(elem): # for <field> in <method>
a
.
get
(
'
reserved
'
,
'
0
'
)
==
'
1
'
,
a
.
get
(
'
reserved
'
,
'
0
'
)
==
'
1
'
,
None
)
None
)
_boolint
=
lambda
x
:
bool
(
int
(
x
))
def
for_method
(
elem
):
# for <method>
def
for_method
(
elem
):
# for <method>
"""
Parse class, return methods
"""
"""
Parse class, return methods
"""
a
=
elem
.
attrib
a
=
elem
.
attrib
return
Method
(
six
.
text_type
(
a
[
'
name
'
]),
return
Method
(
six
.
text_type
(
a
[
'
name
'
]),
bool
(
int
(
a
.
get
(
'
synchronous
'
,
'
0
'
))
)
,
int
(
a
[
'
index
'
]),
_
boolint
(
a
.
get
(
'
synchronous
'
,
'
0
'
)),
int
(
a
[
'
index
'
]),
a
.
get
(
'
label
'
,
None
),
a
.
get
(
'
label
'
,
None
),
get_docs
(
elem
),
get_docs
(
elem
),
[
for_field
(
fie
)
for
fie
in
elem
.
getchildren
()
if
[
for_field
(
fie
)
for
fie
in
elem
.
getchildren
()
if
...
@@ -153,16 +153,20 @@ def for_constant(elem): # for <constant>
...
@@ -153,16 +153,20 @@ def for_constant(elem): # for <constant>
get_docs
(
elem
))
get_docs
(
elem
))
def
_findall_apply
(
xml
,
what
,
fun
):
return
map
(
fun
,
xml
.
findall
(
what
))
def
get_constants
(
xml
):
def
get_constants
(
xml
):
return
[
for_
constant
(
e
)
for
e
in
xml
.
findall
(
'
constant
'
)]
return
_findall_apply
(
xml
,
'
constant
'
,
for
_
constant
)
def
get_classes
(
xml
):
def
get_classes
(
xml
):
return
[
for_
class
(
e
)
for
e
in
xml
.
findall
(
'
class
'
)]
return
_findall_apply
(
xml
,
'
class
'
,
for
_
class
)
def
get_domains
(
xml
):
def
get_domains
(
xml
):
return
[
for_
domain
(
e
)
for
e
in
xml
.
findall
(
'
domain
'
)]
return
_findall_apply
(
xml
,
'
domain
'
,
for
_
domain
)
def
as_unicode
(
callable
):
def
as_unicode
(
callable
):
...
...
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