Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
erp5
Commits
367357b7
Commit
367357b7
authored
Jan 18, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check whether the source code is valid upon validate().
parent
5d48a7a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
product/ERP5Type/Core/DocumentComponent.py
product/ERP5Type/Core/DocumentComponent.py
+21
-0
No files found.
product/ERP5Type/Core/DocumentComponent.py
View file @
367357b7
...
...
@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type.ConsistencyMessage
import
ConsistencyMessage
class
DocumentComponent
(
Base
):
# CMF Type Definition
...
...
@@ -55,6 +56,26 @@ class DocumentComponent(Base):
'Reference'
,
'TextDocument'
)
def
checkConsistency
(
self
,
**
kw
):
"""
XXX-arnau: should probably in a separate Constraint class
"""
if
not
self
.
getTextContent
():
return
[
ConsistencyMessage
(
self
,
object_relative_url
=
self
.
getRelativeUrl
(),
message
=
"No source code"
,
mapping
=
{})]
try
:
self
.
load
()
except
Exception
,
e
:
return
[
ConsistencyMessage
(
self
,
object_relative_url
=
self
.
getRelativeUrl
(),
message
=
"Source code error: %s"
%
e
,
mapping
=
{})]
return
[]
def
load
(
self
,
namespace_dict
=
{}):
"""
Load the source code into the given dict. Using exec() rather than
...
...
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