Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
bf391e07
authored
Jul 18, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: add HumanReadableObject.set()
parent
3f60bd73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
circle/common/models.py
+7
-0
No files found.
circle/common/models.py
View file @
bf391e07
...
@@ -353,6 +353,9 @@ except ImportError:
...
@@ -353,6 +353,9 @@ except ImportError:
class
HumanReadableObject
(
object
):
class
HumanReadableObject
(
object
):
def
__init__
(
self
,
user_text_template
,
admin_text_template
,
params
):
def
__init__
(
self
,
user_text_template
,
admin_text_template
,
params
):
self
.
_set_values
(
user_text_template
,
admin_text_template
,
params
)
def
_set_values
(
self
,
user_text_template
,
admin_text_template
,
params
):
self
.
user_text_template
=
user_text_template
self
.
user_text_template
=
user_text_template
self
.
admin_text_template
=
admin_text_template
self
.
admin_text_template
=
admin_text_template
self
.
params
=
params
self
.
params
=
params
...
@@ -362,6 +365,10 @@ class HumanReadableObject(object):
...
@@ -362,6 +365,10 @@ class HumanReadableObject(object):
return
cls
(
user_text_template
,
return
cls
(
user_text_template
,
admin_text_template
or
user_text_template
,
params
)
admin_text_template
or
user_text_template
,
params
)
def
set
(
self
,
user_text_template
,
admin_text_template
=
None
,
**
params
):
self
.
_set_values
(
user_text_template
,
admin_text_template
or
user_text_template
,
params
)
@classmethod
@classmethod
def
from_dict
(
cls
,
d
):
def
from_dict
(
cls
,
d
):
return
None
if
d
is
None
else
cls
(
**
d
)
return
None
if
d
is
None
else
cls
(
**
d
)
...
...
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