Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
289a2498
Commit
289a2498
authored
10 years ago
by
David Baker
Browse files
Options
Downloads
Patches
Plain Diff
Unnecessary newlines.
parent
3cb5b73c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/rest/client/v1/push_rule.py
+0
-5
0 additions, 5 deletions
synapse/rest/client/v1/push_rule.py
with
0 additions
and
5 deletions
synapse/rest/client/v1/push_rule.py
+
0
−
5
View file @
289a2498
...
@@ -295,7 +295,6 @@ def _add_empty_priority_class_arrays(d):
...
@@ -295,7 +295,6 @@ def _add_empty_priority_class_arrays(d):
d
[
pc
]
=
[]
d
[
pc
]
=
[]
return
d
return
d
def
_instance_handle_from_conditions
(
conditions
):
def
_instance_handle_from_conditions
(
conditions
):
"""
"""
Given a list of conditions, return the instance handle of the
Given a list of conditions, return the instance handle of the
...
@@ -326,7 +325,6 @@ def _filter_ruleset_with_path(ruleset, path):
...
@@ -326,7 +325,6 @@ def _filter_ruleset_with_path(ruleset, path):
return
r
return
r
raise
NotFoundError
raise
NotFoundError
def
_priority_class_from_spec
(
spec
):
def
_priority_class_from_spec
(
spec
):
if
spec
[
'
template
'
]
not
in
PushRuleRestServlet
.
PRIORITY_CLASS_MAP
.
keys
():
if
spec
[
'
template
'
]
not
in
PushRuleRestServlet
.
PRIORITY_CLASS_MAP
.
keys
():
raise
InvalidRuleException
(
"
Unknown template: %s
"
%
(
spec
[
'
kind
'
]))
raise
InvalidRuleException
(
"
Unknown template: %s
"
%
(
spec
[
'
kind
'
]))
...
@@ -337,7 +335,6 @@ def _priority_class_from_spec(spec):
...
@@ -337,7 +335,6 @@ def _priority_class_from_spec(spec):
return
pc
return
pc
def
_priority_class_to_template_name
(
pc
):
def
_priority_class_to_template_name
(
pc
):
if
pc
>
PushRuleRestServlet
.
PRIORITY_CLASS_MAP
[
'
override
'
]:
if
pc
>
PushRuleRestServlet
.
PRIORITY_CLASS_MAP
[
'
override
'
]:
# per-device
# per-device
...
@@ -346,7 +343,6 @@ def _priority_class_to_template_name(pc):
...
@@ -346,7 +343,6 @@ def _priority_class_to_template_name(pc):
else
:
else
:
return
PushRuleRestServlet
.
PRIORITY_CLASS_INVERSE_MAP
[
pc
]
return
PushRuleRestServlet
.
PRIORITY_CLASS_INVERSE_MAP
[
pc
]
def
_rule_to_template
(
rule
):
def
_rule_to_template
(
rule
):
template_name
=
_priority_class_to_template_name
(
rule
[
'
priority_class
'
])
template_name
=
_priority_class_to_template_name
(
rule
[
'
priority_class
'
])
if
template_name
in
[
'
override
'
,
'
underride
'
]:
if
template_name
in
[
'
override
'
,
'
underride
'
]:
...
@@ -363,7 +359,6 @@ def _rule_to_template(rule):
...
@@ -363,7 +359,6 @@ def _rule_to_template(rule):
ret
[
"
pattern
"
]
=
thecond
[
"
pattern
"
]
ret
[
"
pattern
"
]
=
thecond
[
"
pattern
"
]
return
ret
return
ret
def
_strip_device_condition
(
rule
):
def
_strip_device_condition
(
rule
):
for
i
,
c
in
enumerate
(
rule
[
'
conditions
'
]):
for
i
,
c
in
enumerate
(
rule
[
'
conditions
'
]):
if
c
[
'
kind
'
]
==
'
device
'
:
if
c
[
'
kind
'
]
==
'
device
'
:
...
...
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