Commit a3d5add8 authored by Jérome Perrin's avatar Jérome Perrin

make this work with Zope2.8 RPMs


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils/erp5flakes@18913 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1a8da0bc
...@@ -9,7 +9,7 @@ import __builtin__ ...@@ -9,7 +9,7 @@ import __builtin__
# we need Zope and ERP5Type to check code inside business templates # we need Zope and ERP5Type to check code inside business templates
zope_software_home = os.environ.get('SOFTWARE_HOME', zope_software_home = os.environ.get('SOFTWARE_HOME',
'/usr/lib/zope/lib/python/') '/usr/lib/erp5/lib/python/')
sys.path.append(zope_software_home) sys.path.append(zope_software_home)
import ZODB import ZODB
from ZODB.DemoStorage import DemoStorage from ZODB.DemoStorage import DemoStorage
...@@ -20,6 +20,12 @@ import Globals ...@@ -20,6 +20,12 @@ import Globals
execfile(os.path.join(zope_software_home, execfile(os.path.join(zope_software_home,
'Products', 'ERP5Type', 'patches', 'ppml.py')) 'Products', 'ERP5Type', 'patches', 'ppml.py'))
try:
import transaction
begin_transaction = transaction.begin
except ImportError:
def begin_transaction():
get_transaction().begin()
# by default, we ignore warnings about unused imports # by default, we ignore warnings about unused imports
fatal_messages = ( messages.ImportStarUsed, messages.UndefinedName, fatal_messages = ( messages.ImportStarUsed, messages.UndefinedName,
...@@ -112,7 +118,7 @@ def checkBusinessTemplate(path): ...@@ -112,7 +118,7 @@ def checkBusinessTemplate(path):
return _connection return _connection
db = ZODB.DB(DemoStorage(quota=(1<<20))) db = ZODB.DB(DemoStorage(quota=(1<<20)))
_connection = db.open() _connection = db.open()
get_transaction().begin() begin_transaction()
return _connection return _connection
warnings = 0 warnings = 0
......
from setuptools import setup from setuptools import setup
name = "erp5flakes" name = "erp5flakes"
version = '0.1' version = '0.3'
setup( setup(
name = name, name = name,
......
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