Commit 838bcb5e authored by Jérome Perrin's avatar Jérome Perrin

also remove pyc when removing local psheet, documents, extensions ...



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12721 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c64c71a4
...@@ -383,9 +383,10 @@ def getLocalPropertySheetList(): ...@@ -383,9 +383,10 @@ def getLocalPropertySheetList():
def removeLocalPropertySheet(class_id): def removeLocalPropertySheet(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "PropertySheet") path = os.path.join(instance_home, "PropertySheet")
path = os.path.join(path, "%s.py" % class_id) for ext in ('py', 'pyc', 'pyo'):
if os.path.exists(path): f = os.path.join(path, "%s.%s" % (class_id, ext))
os.remove(path) if os.path.exists(f):
os.remove(f)
def readLocalPropertySheet(class_id): def readLocalPropertySheet(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
...@@ -491,8 +492,10 @@ def getLocalConstraintList(): ...@@ -491,8 +492,10 @@ def getLocalConstraintList():
def removeLocalExtension(class_id): def removeLocalExtension(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "Extensions") path = os.path.join(instance_home, "Extensions")
path = os.path.join(path, "%s.py" % class_id) for ext in ('py', 'pyc', 'pyo'):
os.remove(path) f = os.path.join(path, "%s.%s" % (class_id, ext))
if os.path.exists(f):
os.remove(f)
def readLocalExtension(class_id): def readLocalExtension(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
...@@ -506,8 +509,10 @@ def readLocalExtension(class_id): ...@@ -506,8 +509,10 @@ def readLocalExtension(class_id):
def removeLocalTest(class_id): def removeLocalTest(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "tests") path = os.path.join(instance_home, "tests")
path = os.path.join(path, "%s.py" % class_id) for ext in ('py', 'pyc', 'pyo'):
os.remove(path) f = os.path.join(path, "%s.%s" % (class_id, ext))
if os.path.exists(f):
os.remove(f)
def readLocalTest(class_id): def readLocalTest(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
...@@ -563,8 +568,10 @@ def writeLocalConstraint(class_id, text, create=1, instance_home=None): ...@@ -563,8 +568,10 @@ def writeLocalConstraint(class_id, text, create=1, instance_home=None):
def removeLocalConstraint(class_id): def removeLocalConstraint(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "Constraint") path = os.path.join(instance_home, "Constraint")
path = os.path.join(path, "%s.py" % class_id) for ext in ('py', 'pyc', 'pyo'):
os.remove(path) f = os.path.join(path, "%s.%s" % (class_id, ext))
if os.path.exists(f):
os.remove(f)
def getLocalDocumentList(): def getLocalDocumentList():
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
...@@ -580,8 +587,10 @@ def getLocalDocumentList(): ...@@ -580,8 +587,10 @@ def getLocalDocumentList():
def removeLocalDocument(class_id): def removeLocalDocument(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "Document") path = os.path.join(instance_home, "Document")
path = os.path.join(path, "%s.py" % class_id) for ext in ('py', 'pyc', 'pyo'):
os.remove(path) f = os.path.join(path, "%s.%s" % (class_id, ext))
if os.path.exists(f):
os.remove(f)
def readLocalDocument(class_id): def readLocalDocument(class_id):
instance_home = getConfiguration().instancehome instance_home = getConfiguration().instancehome
......
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