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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
b9ed6f66
Commit
b9ed6f66
authored
Jun 18, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tout le bordel
parent
12775b38
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
14 deletions
+32
-14
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+3
-1
product/ERP5Configurator/Document/PermissionConfiguratorItem.py
...t/ERP5Configurator/Document/PermissionConfiguratorItem.py
+1
-1
product/ERP5Configurator/Document/RoleConfiguratorItem.py
product/ERP5Configurator/Document/RoleConfiguratorItem.py
+0
-1
product/ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
.../ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
+1
-2
product/ERP5Form/Form.py
product/ERP5Form/Form.py
+4
-3
product/ERP5Type/Tool/TypesTool.py
product/ERP5Type/Tool/TypesTool.py
+1
-1
product/ERP5Type/dynamic/component_package.py
product/ERP5Type/dynamic/component_package.py
+3
-1
product/ERP5Type/dynamic/dynamic_module.py
product/ERP5Type/dynamic/dynamic_module.py
+1
-0
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+9
-1
product/ERP5Type/dynamic/portal_type_class.py
product/ERP5Type/dynamic/portal_type_class.py
+9
-3
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
b9ed6f66
...
...
@@ -1657,6 +1657,7 @@ class CategoryTemplateItem(ObjectTemplateItem):
def
afterInstall
(
self
):
if
self
.
_installed_new_category
:
# reset accessors if we installed a new category
# XXX do not reset test
self
.
portal_types
.
resetDynamicDocumentsOnceAtTransactionBoundary
()
class
SkinTemplateItem
(
ObjectTemplateItem
):
...
...
@@ -3509,6 +3510,7 @@ class FilesystemDocumentTemplateItem(BaseTemplateItem):
return
modified_object_list
def
_resetDynamicModules
(
self
):
print
"_resetDynamicModules"
# before any import, flush all ZODB caches to force a DB reload
# otherwise we could have objects trying to get commited while
# holding reference to a class that is no longer the same one as
...
...
@@ -3520,7 +3522,7 @@ class FilesystemDocumentTemplateItem(BaseTemplateItem):
# connection
portal
=
self
.
getPortalObject
()
portal
.
_p_jar
.
db
().
cacheMinimize
()
synchronizeDynamicModules
(
portal
,
force
=
True
)
synchronizeDynamicModules
(
portal
,
force
=
True
,
reset_test
=
False
)
gc
.
collect
()
def
install
(
self
,
context
,
trashbin
,
**
kw
):
...
...
product/ERP5Configurator/Document/PermissionConfiguratorItem.py
View file @
b9ed6f66
...
...
@@ -72,7 +72,7 @@ class PermissionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
# add to module map
module_permissions_map
[
module_id
]
=
module_permissions
# set permissions
in fake
site
# set permissions
on
site
portal
=
self
.
getPortalObject
()
for
module_id
,
permissions_map
in
module_permissions_map
.
items
():
if
permissions_map
!=
{}:
...
...
product/ERP5Configurator/Document/RoleConfiguratorItem.py
View file @
b9ed6f66
...
...
@@ -86,7 +86,6 @@ class RoleConfiguratorItem(ConfiguratorItemMixin, XMLObject):
mod_conf_list
.
append
(
conf_dict
)
portal_type_dict
[
portal_type
]
=
mod_conf_list
## Update fake site
# XXX rafael: improve this, the ignore list is quite ugly.
ignore_list
=
[]
portal_type_id_list
=
portal
.
portal_types
.
objectIds
()
...
...
product/ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
View file @
b9ed6f66
...
...
@@ -35,8 +35,7 @@ from Products.ERP5Type.Cache import CachingMethod
from
zLOG
import
LOG
,
INFO
class
StandardBT5ConfiguratorItem
(
ConfiguratorItemMixin
,
XMLObject
):
""" This class will install standard ERP5 template from a repository to
fake site. """
""" This class will install standard ERP5 template from a repository """
meta_type
=
'ERP5 Standard BT5 Configurator Item'
portal_type
=
'Standard BT5 Configurator Item'
...
...
product/ERP5Form/Form.py
View file @
b9ed6f66
...
...
@@ -232,9 +232,10 @@ class TALESValue(StaticValue):
except
:
# We add this safety exception to make sure we always get
# something reasonable rather than generate plenty of errors
LOG
(
'ERP5Form'
,
PROBLEM
,
'Field.get_value %r [%s], exception on tales_expr: '
%
(
field
,
id
),
error
=
sys
.
exc_info
())
if
0
:
LOG
(
'ERP5Form'
,
PROBLEM
,
'Field.get_value %r [%s], exception on tales_expr: '
%
(
field
,
id
),
error
=
sys
.
exc_info
())
# field may be ProxyField
# here we avoid calling field.get_recursive_orig_value
# on all fields because it can be acquired from another
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
b9ed6f66
...
...
@@ -284,7 +284,7 @@ class TypesTool(TypeProvider):
WARNING: COSTLY! Please double-check that
resetDynamicDocumentsOnceAtTransactionBoundary can't be used instead.
"""
synchronizeDynamicModules
(
self
,
force
=
True
)
synchronizeDynamicModules
(
self
,
force
=
True
,
reset_test
=
False
)
def
_finalizeMigration
(
self
):
"""Compatibility code to finalize migration from CMF Types Tool"""
...
...
product/ERP5Type/dynamic/component_package.py
View file @
b9ed6f66
...
...
@@ -78,7 +78,7 @@ class ComponentDynamicPackage(ModuleType):
self
.
__registry_dict
=
collections
.
defaultdict
(
dict
)
self
.
__fullname_source_code_dict
=
{}
# Add this module to sys.
path
for future imports
# Add this module to sys.
module
for future imports
sys
.
modules
[
namespace
]
=
self
# Add the import hook
...
...
@@ -253,6 +253,8 @@ class ComponentDynamicPackage(ModuleType):
#
# Also, handle the case where find_module() may be called without import
# statement as it does change anything in sys.modules
if
'test'
in
fullname
:
print
"Ahaha"
,
fullname
import_lock_held
=
True
try
:
imp
.
release_lock
()
...
...
product/ERP5Type/dynamic/dynamic_module.py
View file @
b9ed6f66
...
...
@@ -103,6 +103,7 @@ def initializeDynamicModules():
erp5.component.test:
holds Live Test modules previously found in bt5 in $INSTANCE_HOME/test
"""
print
"initializeDynamicModules"
erp5
=
PackageType
(
"erp5"
)
# Document classes without physical import path
...
...
product/ERP5Type/dynamic/lazy_class.py
View file @
b9ed6f66
...
...
@@ -20,6 +20,7 @@ from zLOG import LOG, WARNING, BLATHER
from
portal_type_class
import
generatePortalTypeClass
from
accessor_holder
import
AccessorHolderType
import
persistent_migration
import
weakref
class
ERP5BaseBroken
(
Broken
,
ERP5Base
):
# PersistentBroken can't be reused directly
...
...
@@ -132,6 +133,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
# register which classes subclass portal type classes
subclass_register
=
{}
# XXX ideal defaultdict(list) wannabe
# XXX weak ref ???
def
__init__
(
cls
,
name
,
bases
,
dictionary
):
"""
...
...
@@ -139,9 +141,13 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
created, or when a class inheriting a portal type
class is created
"""
#print "__init__", cls, name
for
parent
in
bases
:
if
issubclass
(
type
(
parent
),
PortalTypeMetaClass
):
PortalTypeMetaClass
.
subclass_register
.
setdefault
(
parent
,
[]).
append
(
cls
)
PortalTypeMetaClass
.
subclass_register
.
setdefault
(
parent
,
weakref
.
WeakSet
([])
#set()
).
add
(
cls
)
cls
.
workflow_method_registry
=
{}
...
...
@@ -183,6 +189,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
return
property_dict
.
itervalues
()
def
resetAcquisition
(
cls
):
#print "resetAcquisition", cls
# First, fill the __get__ slot of the class
# that has been null'ed after resetting its __bases__
# This descriptor is the magic allowing __of__ and our
...
...
@@ -191,6 +198,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
# And we need to do the same thing on subclasses
for
subclass
in
PortalTypeMetaClass
.
getSubclassList
(
cls
):
#print " resetAcquisition", subclass
pmc_init_of
(
subclass
)
def
setupSecurity
(
cls
):
...
...
product/ERP5Type/dynamic/portal_type_class.py
View file @
b9ed6f66
...
...
@@ -286,7 +286,7 @@ def loadTempPortalTypeClass(portal_type_name):
last_sync
=
-
1
_bootstrapped
=
set
()
def
synchronizeDynamicModules
(
context
,
force
=
False
):
def
synchronizeDynamicModules
(
context
,
force
=
False
,
reset_test
=
True
):
"""
Allow resetting all classes to ghost state, most likely done after
adding and removing mixins on the fly
...
...
@@ -362,11 +362,17 @@ def synchronizeDynamicModules(context, force=False):
" property sheet tool failed"
,
error
=
sys
.
exc_info
())
raise
LOG
(
"ERP5Type.dynamic"
,
0
,
"Resetting dynamic classes"
)
LOG
(
"ERP5Type.dynamic"
,
0
,
"Resetting dynamic classes (reset_test:%s)"
%
reset_test
)
if
reset_test
:
import
ipdb
;
ipdb
.
set_trace
()
try
:
for
class_name
,
klass
in
inspect
.
getmembers
(
erp5
.
portal_type
,
inspect
.
isclass
):
klass
.
restoreGhostState
()
if
reset_test
:
klass
.
restoreGhostState
()
elif
not
'Test'
in
class_name
:
klass
.
restoreGhostState
()
# Clear accessor holders of ZODB Property Sheets and Portal Types
erp5
.
accessor_holder
.
clear
()
...
...
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