Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
ef5d6d9c
Commit
ef5d6d9c
authored
Aug 01, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: cleanup ActiveResult
parent
661d5ca9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
25 deletions
+7
-25
product/CMFActivity/ActiveResult.py
product/CMFActivity/ActiveResult.py
+7
-25
No files found.
product/CMFActivity/ActiveResult.py
View file @
ef5d6d9c
...
...
@@ -26,10 +26,8 @@
#
##############################################################################
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Utils
import
getPath
from
zLOG
import
LOG
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
from
zLOG
import
LOG
,
INFO
from
Products.PythonScripts.Utility
import
allow_class
class
ActiveResult
:
...
...
@@ -39,40 +37,24 @@ class ActiveResult:
(and eventually, errors)
"""
# Standard severities
TRACE
=
-
300
DEBUG
=
-
200
BLATHER
=
-
100
INFO
=
0
PROBLEM
=
100
WARNING
=
100
ERROR
=
200
PANIC
=
300
# getProperty default
_MARKER
=
None
def
__init__
(
self
,
summary
=
''
,
severity
=
INFO
,
detail
=
''
,
**
kw
):
"""
set all parameters
"""
if
kw
.
has_key
(
'object_path'
):
self
.
object_path
=
getPath
(
kw
[
'object_path'
],
tuple
=
1
)
del
kw
[
'object_path'
]
self
.
summary
=
summary
self
.
severity
=
severity
self
.
detail
=
detail
self
.
__dict__
.
update
(
kw
)
self
.
edit
(
**
kw
)
def
edit
(
self
,
**
kw
):
"""
set all parameters
"""
if
kw
.
has_key
(
'object_path'
):
self
.
object_path
=
getPath
(
kw
[
'object_path'
],
tuple
=
1
)
del
kw
[
'object_path'
]
if
'object_path'
in
kw
:
self
.
object_path
=
getPath
(
kw
.
pop
(
'object_path'
),
tuple
=
1
)
self
.
__dict__
.
update
(
kw
)
def
getProperty
(
self
,
value
,
d
=
_MARKER
,
**
kw
):
def
getProperty
(
self
,
value
,
d
=
None
):
"""
A simple getter
"""
...
...
@@ -88,13 +70,13 @@ class ActiveResult:
"""
Tells if the result is a result or an error
"""
return
self
.
severity
<=
self
.
INFO
return
self
.
severity
<=
INFO
def
isError
(
self
):
"""
Tells if the result is a result or an error
"""
return
self
.
severity
>
self
.
INFO
return
self
.
severity
>
INFO
allow_class
(
ActiveResult
)
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