Commit 9c8b5a1f authored by Jérome Perrin's avatar Jérome Perrin

- use setuptools

- update for pyflakes 0.3.0 internal changes
- specify version in install_requires
- allow to specify the path for file containing ppml patches


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils/erp5flakes@26858 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 36f731b7
#!/usr/bin/python2.4
import compiler import compiler
import sys import sys
import os import os
from pyflakes import Checker from pyflakes.checker import Checker
from pyflakes import messages from pyflakes import messages
import __builtin__ import __builtin__
...@@ -16,9 +15,12 @@ from ZODB.DemoStorage import DemoStorage ...@@ -16,9 +15,12 @@ from ZODB.DemoStorage import DemoStorage
from OFS import XMLExportImport from OFS import XMLExportImport
customImporters = { XMLExportImport.magic: XMLExportImport.importXML } customImporters = { XMLExportImport.magic: XMLExportImport.importXML }
import Globals import Globals
# load ERP5Type ppml monkey patches # load ERP5Type ppml monkey patches
execfile(os.path.join(zope_software_home, ppml_file = os.environ.get('ERP5Type.patches.ppml.__file__',
os.path.join(zope_software_home,
'Products', 'ERP5Type', 'patches', 'ppml.py')) 'Products', 'ERP5Type', 'patches', 'ppml.py'))
execfile(ppml_file)
try: try:
import transaction import transaction
...@@ -158,8 +160,9 @@ def isProduct(path): ...@@ -158,8 +160,9 @@ def isProduct(path):
def isBusinessTemplate(path): def isBusinessTemplate(path):
return os.path.exists(os.path.join(path, 'bt', 'revision')) return os.path.exists(os.path.join(path, 'bt', 'revision'))
warnings = 0 def main():
for arg in sys.argv[1:]: warnings = 0
for arg in sys.argv[1:]:
if isProduct(arg): if isProduct(arg):
warnings += checkZopeProduct(arg) warnings += checkZopeProduct(arg)
elif isBusinessTemplate(arg): elif isBusinessTemplate(arg):
...@@ -167,5 +170,6 @@ for arg in sys.argv[1:]: ...@@ -167,5 +170,6 @@ for arg in sys.argv[1:]:
else: else:
print >> sys.stderr, 'ignoring path', arg print >> sys.stderr, 'ignoring path', arg
raise SystemExit(warnings > 0) raise SystemExit(warnings > 0)
# vim: sw=4 # vim: sw=4
from setuptools import setup from setuptools import setup
name = "erp5flakes" name = "erp5flakes"
version = '0.3' version = '0.4'
setup( setup(
name = name, name = name,
...@@ -20,7 +20,8 @@ setup( ...@@ -20,7 +20,8 @@ setup(
"Framework :: Zope2", "Framework :: Zope2",
"Programming Language :: Python", "Programming Language :: Python",
], ],
scripts = ["bin/erp5flakes"], install_requires = ['pyflakes==0.3.0', ], # ZODB ERP5Type
install_requires = ['pyflakes', ], # ZODB ERP5Type entry_points = {'console_scripts':
[ 'erp5flakes = erp5flakes:main',]},
) )
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