Commit 810490e2 authored by Ivan Tyagov's avatar Ivan Tyagov

Try to create parent directories for PropertySheet and Constraints if not already present.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24664 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa11783e
...@@ -51,7 +51,7 @@ from Products.ERP5Type import Permissions ...@@ -51,7 +51,7 @@ from Products.ERP5Type import Permissions
from Products.ERP5Type import Constraint from Products.ERP5Type import Constraint
from Products.ERP5Type.Cache import getReadOnlyTransactionCache from Products.ERP5Type.Cache import getReadOnlyTransactionCache
from zLOG import LOG, BLATHER, PROBLEM from zLOG import LOG, BLATHER, PROBLEM, WARNING
##################################################### #####################################################
...@@ -457,6 +457,9 @@ def writeLocalPropertySheet(class_id, text, create=1, instance_home=None): ...@@ -457,6 +457,9 @@ def writeLocalPropertySheet(class_id, text, create=1, instance_home=None):
if instance_home is None: if instance_home is None:
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "PropertySheet") path = os.path.join(instance_home, "PropertySheet")
if not os.path.exists(path):
os.mkdir(path)
LOG('ERP5Type', WARNING, 'Created missing but required directory: %s' %path)
path = os.path.join(path, "%s.py" % class_id) path = os.path.join(path, "%s.py" % class_id)
if create: if create:
if os.path.exists(path): if os.path.exists(path):
...@@ -638,6 +641,9 @@ def writeLocalConstraint(class_id, text, create=1, instance_home=None): ...@@ -638,6 +641,9 @@ def writeLocalConstraint(class_id, text, create=1, instance_home=None):
if instance_home is None: if instance_home is None:
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "Constraint") path = os.path.join(instance_home, "Constraint")
if not os.path.exists(path):
os.mkdir(path)
LOG('ERP5Type', WARNING, 'Created missing but required directory: %s' %path)
path = os.path.join(path, "%s.py" % class_id) path = os.path.join(path, "%s.py" % class_id)
if create: if create:
if os.path.exists(path): if os.path.exists(path):
......
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