[Erp5-report] r12721 - /erp5/trunk/products/ERP5Type/Utils.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Feb 15 12:47:30 CET 2007
Author: jerome
Date: Thu Feb 15 12:47:28 2007
New Revision: 12721
URL: http://svn.erp5.org?rev=12721&view=rev
Log:
also remove pyc when removing local psheet, documents, extensions ...
Modified:
erp5/trunk/products/ERP5Type/Utils.py
Modified: erp5/trunk/products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Utils.py?rev=12721&r1=12720&r2=12721&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py (original)
+++ erp5/trunk/products/ERP5Type/Utils.py Thu Feb 15 12:47:28 2007
@@ -383,9 +383,10 @@
def removeLocalPropertySheet(class_id):
instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "PropertySheet")
- path = os.path.join(path, "%s.py" % class_id)
- if os.path.exists(path):
- os.remove(path)
+ for ext in ('py', 'pyc', 'pyo'):
+ f = os.path.join(path, "%s.%s" % (class_id, ext))
+ if os.path.exists(f):
+ os.remove(f)
def readLocalPropertySheet(class_id):
instance_home = getConfiguration().instancehome
@@ -491,8 +492,10 @@
def removeLocalExtension(class_id):
instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "Extensions")
- path = os.path.join(path, "%s.py" % class_id)
- os.remove(path)
+ for ext in ('py', 'pyc', 'pyo'):
+ f = os.path.join(path, "%s.%s" % (class_id, ext))
+ if os.path.exists(f):
+ os.remove(f)
def readLocalExtension(class_id):
instance_home = getConfiguration().instancehome
@@ -506,8 +509,10 @@
def removeLocalTest(class_id):
instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "tests")
- path = os.path.join(path, "%s.py" % class_id)
- os.remove(path)
+ for ext in ('py', 'pyc', 'pyo'):
+ f = os.path.join(path, "%s.%s" % (class_id, ext))
+ if os.path.exists(f):
+ os.remove(f)
def readLocalTest(class_id):
instance_home = getConfiguration().instancehome
@@ -563,8 +568,10 @@
def removeLocalConstraint(class_id):
instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "Constraint")
- path = os.path.join(path, "%s.py" % class_id)
- os.remove(path)
+ for ext in ('py', 'pyc', 'pyo'):
+ f = os.path.join(path, "%s.%s" % (class_id, ext))
+ if os.path.exists(f):
+ os.remove(f)
def getLocalDocumentList():
instance_home = getConfiguration().instancehome
@@ -580,8 +587,10 @@
def removeLocalDocument(class_id):
instance_home = getConfiguration().instancehome
path = os.path.join(instance_home, "Document")
- path = os.path.join(path, "%s.py" % class_id)
- os.remove(path)
+ for ext in ('py', 'pyc', 'pyo'):
+ f = os.path.join(path, "%s.%s" % (class_id, ext))
+ if os.path.exists(f):
+ os.remove(f)
def readLocalDocument(class_id):
instance_home = getConfiguration().instancehome
More information about the Erp5-report
mailing list