Commit a179b4d7 authored by Jean-Paul Smets's avatar Jean-Paul Smets

added import of local property sheet class definition


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1338 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec95f322
......@@ -521,6 +521,28 @@ def initializeLocalDocumentRegistry():
LOG('Failed to add local document to ERP5Type repository: %s (%s)' % (module_name, document_path),0,'')
print 'Failed to add local document to ERP5Type repository: %s (%s)' % (module_name, document_path)
def initializeLocalPropertySheetRegistry():
if not getConfiguration: return
instance_home = getConfiguration().instancehome
document_path = os.path.join(instance_home, "PropertySheet")
python_file_expr = re.compile("py$")
# For unit testing.
if os.access(document_path, os.F_OK):
file_list = os.listdir(document_path)
else:
file_list = ()
for file_name in file_list:
if file_name != '__init__.py':
if python_file_expr.search(file_name,1):
module_name = file_name[0:-3]
try:
importLocalPropertySheet(module_name, path = document_path)
LOG('Added local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path),0,'')
print 'Added local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path)
except:
LOG('Failed to add local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path),0,'')
print 'Failed to add local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path)
#####################################################
# Product initialization
#####################################################
......
......@@ -63,6 +63,9 @@ def initialize( context ):
# We should register product classes at some point
from Products.ERP5Type.InitGenerator import initializeProductDocumentRegistry
initializeProductDocumentRegistry()
# We should register local property sheets at some point
from Products.ERP5Type.Utils import initializeLocalPropertySheetRegistry
initializeLocalPropertySheetRegistry()
# We should register local classes at some point
from Products.ERP5Type.Utils import initializeLocalDocumentRegistry
initializeLocalDocumentRegistry()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment