Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
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 @@
...
@@ -26,10 +26,8 @@
#
#
##############################################################################
##############################################################################
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Utils
import
getPath
from
Products.ERP5Type.Utils
import
getPath
from
zLOG
import
LOG
from
zLOG
import
LOG
,
INFO
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
from
Products.PythonScripts.Utility
import
allow_class
from
Products.PythonScripts.Utility
import
allow_class
class
ActiveResult
:
class
ActiveResult
:
...
@@ -39,40 +37,24 @@ class ActiveResult:
...
@@ -39,40 +37,24 @@ class ActiveResult:
(and eventually, errors)
(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
):
def
__init__
(
self
,
summary
=
''
,
severity
=
INFO
,
detail
=
''
,
**
kw
):
"""
"""
set all parameters
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
.
summary
=
summary
self
.
severity
=
severity
self
.
severity
=
severity
self
.
detail
=
detail
self
.
detail
=
detail
self
.
__dict__
.
update
(
kw
)
self
.
edit
(
**
kw
)
def
edit
(
self
,
**
kw
):
def
edit
(
self
,
**
kw
):
"""
"""
set all parameters
set all parameters
"""
"""
if
kw
.
has_key
(
'object_path'
):
if
'object_path'
in
kw
:
self
.
object_path
=
getPath
(
kw
[
'object_path'
],
tuple
=
1
)
self
.
object_path
=
getPath
(
kw
.
pop
(
'object_path'
),
tuple
=
1
)
del
kw
[
'object_path'
]
self
.
__dict__
.
update
(
kw
)
self
.
__dict__
.
update
(
kw
)
def
getProperty
(
self
,
value
,
d
=
_MARKER
,
**
kw
):
def
getProperty
(
self
,
value
,
d
=
None
):
"""
"""
A simple getter
A simple getter
"""
"""
...
@@ -88,13 +70,13 @@ class ActiveResult:
...
@@ -88,13 +70,13 @@ class ActiveResult:
"""
"""
Tells if the result is a result or an error
Tells if the result is a result or an error
"""
"""
return
self
.
severity
<=
self
.
INFO
return
self
.
severity
<=
INFO
def
isError
(
self
):
def
isError
(
self
):
"""
"""
Tells if the result is a result or an error
Tells if the result is a result or an error
"""
"""
return
self
.
severity
>
self
.
INFO
return
self
.
severity
>
INFO
allow_class
(
ActiveResult
)
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