From 6877efae9d34489027770342e51dceaab37eab2e Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Fri, 19 Feb 2010 07:06:42 +0000
Subject: [PATCH] Added one prefix (Form) and follow more closely
 checkConsistency API

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32837 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/CodingStyle.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/product/ERP5Type/CodingStyle.py b/product/ERP5Type/CodingStyle.py
index 6f78f38dff..7b1bf0fe86 100644
--- a/product/ERP5Type/CodingStyle.py
+++ b/product/ERP5Type/CodingStyle.py
@@ -79,18 +79,20 @@ def getSkinPrefixList(self):
     'NotificationTool',
     'ERP5Site',
     'ERP5Type',
+    'Form', # Acceptable for ERP5 Forms which will soon become portal types too
   ))
 
   skin_prefix_list = set(skin_prefix_list)
   return skin_prefix_list
 
 # Generic method to check consistency of a skin item
-def checkConsistency(self, source_code=None):
+def checkConsistency(self, fixit=0, source_code=None):
   """
   Make sure skin folder item has appropriate prefix
   and that its source code, if any, does not contain
   calls to legacy methods
   """
+  if fixit: raise NotImplementedError
   message_list = []
   portal_path = self.getPortalObject().getPath()
   portal_path_len = len(portal_path)
@@ -116,16 +118,16 @@ def checkConsistency(self, source_code=None):
   return message_list
 
 # Add checkConsistency to Python Scripts
-def checkPythonScriptConsistency(self):
-  return checkConsistency(self, source_code=self.body())
+def checkPythonScriptConsistency(self, fixit=0):
+  return checkConsistency(self, fixit=fixit, source_code=self.body())
 
 from Products.PythonScripts.PythonScript import PythonScript
 PythonScript.checkConsistency= checkPythonScriptConsistency
 PythonScript.checkConsistency__roles__ = ('Manager',) # A hack to protect the method
 
 # Add checkConsistency to Page Templates
-def checkPageTemplateConsistency(self):
-  return checkConsistency(self, source_code=self.read())
+def checkPageTemplateConsistency(self, fixit=0):
+  return checkConsistency(self, fixit=fixit, source_code=self.read())
 
 from Products.PageTemplates.PageTemplate import PageTemplate
 PageTemplate.checkConsistency= checkPageTemplateConsistency
-- 
2.30.9