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 sys
import os
from pyflakes import Checker
from pyflakes.checker import Checker
from pyflakes import messages
import __builtin__
......@@ -16,9 +15,12 @@ from ZODB.DemoStorage import DemoStorage
from OFS import XMLExportImport
customImporters = { XMLExportImport.magic: XMLExportImport.importXML }
import Globals
# load ERP5Type ppml monkey patches
execfile(os.path.join(zope_software_home,
'Products', 'ERP5Type', 'patches', 'ppml.py'))
ppml_file = os.environ.get('ERP5Type.patches.ppml.__file__',
os.path.join(zope_software_home,
'Products', 'ERP5Type', 'patches', 'ppml.py'))
execfile(ppml_file)
try:
import transaction
......@@ -158,14 +160,16 @@ def isProduct(path):
def isBusinessTemplate(path):
return os.path.exists(os.path.join(path, 'bt', 'revision'))
warnings = 0
for arg in sys.argv[1:]:
if isProduct(arg):
warnings += checkZopeProduct(arg)
elif isBusinessTemplate(arg):
warnings += checkBusinessTemplate(arg)
else:
print >> sys.stderr, 'ignoring path', arg
def main():
warnings = 0
for arg in sys.argv[1:]:
if isProduct(arg):
warnings += checkZopeProduct(arg)
elif isBusinessTemplate(arg):
warnings += checkBusinessTemplate(arg)
else:
print >> sys.stderr, 'ignoring path', arg
raise SystemExit(warnings > 0)
raise SystemExit(warnings > 0)
# vim: sw=4
from setuptools import setup
name = "erp5flakes"
version = '0.3'
version = '0.4'
setup(
name = name,
......@@ -20,7 +20,8 @@ setup(
"Framework :: Zope2",
"Programming Language :: Python",
],
scripts = ["bin/erp5flakes"],
install_requires = ['pyflakes', ], # ZODB ERP5Type
install_requires = ['pyflakes==0.3.0', ], # 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