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
Mukul
erp5
Commits
dcfcaed3
Commit
dcfcaed3
authored
Jan 24, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reindent properly Component document class.
parent
2b6ffbac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
45 deletions
+45
-45
product/ERP5Type/Core/Component.py
product/ERP5Type/Core/Component.py
+45
-45
No files found.
product/ERP5Type/Core/Component.py
View file @
dcfcaed3
...
@@ -33,56 +33,56 @@ from Products.ERP5Type import Permissions
...
@@ -33,56 +33,56 @@ from Products.ERP5Type import Permissions
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type.ConsistencyMessage
import
ConsistencyMessage
from
Products.ERP5Type.ConsistencyMessage
import
ConsistencyMessage
class
Component
(
Base
):
class
Component
(
Base
):
# CMF Type Definition
# CMF Type Definition
meta_type
=
'ERP5 Component'
meta_type
=
'ERP5 Component'
portal_type
=
'Component'
portal_type
=
'Component'
isPortalContent
=
1
isPortalContent
=
1
isRADContent
=
1
isRADContent
=
1
isDelivery
=
ConstantGetter
(
'isDelivery'
,
value
=
True
)
isDelivery
=
ConstantGetter
(
'isDelivery'
,
value
=
True
)
# Declarative security
# Declarative security
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# Declarative properties
# Declarative properties
property_sheets
=
(
'Base'
,
property_sheets
=
(
'Base'
,
'XMLObject'
,
'XMLObject'
,
'CategoryCore'
,
'CategoryCore'
,
'DublinCore'
,
'DublinCore'
,
'Version'
,
'Version'
,
'Reference'
,
'Reference'
,
'TextDocument'
)
'TextDocument'
)
def
checkConsistency
(
self
,
*
args
,
**
kw
):
def
checkConsistency
(
self
,
*
args
,
**
kw
):
"""
"""
XXX-arnau: should probably in a separate Constraint class
XXX-arnau: should probably in a separate Constraint class
"""
"""
if
not
self
.
getTextContent
():
if
not
self
.
getTextContent
():
return
[
ConsistencyMessage
(
self
,
return
[
ConsistencyMessage
(
self
,
object_relative_url
=
self
.
getRelativeUrl
(),
object_relative_url
=
self
.
getRelativeUrl
(),
message
=
"No source code"
,
message
=
"No source code"
,
mapping
=
{})]
mapping
=
{})]
try
:
try
:
self
.
load
()
self
.
load
()
except
Exception
,
e
:
except
Exception
,
e
:
return
[
ConsistencyMessage
(
self
,
return
[
ConsistencyMessage
(
self
,
object_relative_url
=
self
.
getRelativeUrl
(),
object_relative_url
=
self
.
getRelativeUrl
(),
message
=
"Source code error: %s"
%
e
,
message
=
"Source code error: %s"
%
e
,
mapping
=
{})]
mapping
=
{})]
return
[]
return
[]
def
load
(
self
,
namespace_dict
=
{}):
def
load
(
self
,
namespace_dict
=
{}):
"""
"""
Load the source code into the given dict. Using exec() rather than
Load the source code into the given dict. Using exec() rather than
imp.load_source() as the latter would required creating an intermediary
imp.load_source() as the latter would required creating an intermediary
file. Also, for traceback readability sake, the destination module
file. Also, for traceback readability sake, the destination module
__dict__ is given rather than creating an empty dict and returning
__dict__ is given rather than creating an empty dict and returning
it. By default namespace_dict is an empty dict to allow checking the
it. By default namespace_dict is an empty dict to allow checking the
source code before validate.
source code before validate.
"""
"""
exec
self
.
getTextContent
()
in
namespace_dict
exec
self
.
getTextContent
()
in
namespace_dict
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