Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3304837c
authored
Apr 28, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: reverse for operations
parent
ff7dcb4f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
circle/common/operations.py
+10
-1
No files found.
circle/common/operations.py
View file @
3304837c
from
inspect
import
getargspec
from
inspect
import
getargspec
from
logging
import
getLogger
from
logging
import
getLogger
from
.models
import
activity_context
from
.models
import
activity_context
,
activity_code_separator
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
...
@@ -170,6 +170,15 @@ class OperatedMixin(object):
...
@@ -170,6 +170,15 @@ class OperatedMixin(object):
else
:
else
:
yield
op
yield
op
def
get_operation_from_activity_code
(
self
,
activity_code
):
sep
=
activity_code_separator
ops
=
getattr
(
self
,
operation_registry_name
,
{})
.
values
()
for
op
in
ops
:
if
activity_code
.
endswith
(
sep
+
op
.
activity_code_suffix
):
return
op
else
:
return
None
def
register_operation
(
op_cls
,
op_id
=
None
,
target_cls
=
None
):
def
register_operation
(
op_cls
,
op_id
=
None
,
target_cls
=
None
):
"""Register the specified operation with the target class.
"""Register the specified operation with the target class.
...
...
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