Commit 9776cfc7 authored by Jim Fulton's avatar Jim Fulton

Removed BoboPOS compatibility code.

parent b427bb74
...@@ -376,11 +376,9 @@ class ApplicationManager(Folder,CacheManager): ...@@ -376,11 +376,9 @@ class ApplicationManager(Folder,CacheManager):
return self._p_jar.db().getName() return self._p_jar.db().getName()
def db_size(self): def db_size(self):
if Globals.DatabaseVersion=='2': s=self._p_jar.db().getSize()
s=os.stat(self.db_name())[6] if type(s) is type(''):
else: return s
s=self._p_jar.db().getSize()
if type(s) is type(''): return s
if s >= 1048576.0: return '%.1fM' % (s/1048576.0) if s >= 1048576.0: return '%.1fM' % (s/1048576.0)
return '%.1fK' % (s/1024.0) return '%.1fK' % (s/1024.0)
......
...@@ -64,7 +64,7 @@ class ZClassBasicSheet(OFS.PropertySheets.PropertySheet, ...@@ -64,7 +64,7 @@ class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
def classIcon(self): return self.getClassAttr('icon','') def classIcon(self): return self.getClassAttr('icon','')
def show_class_id(self): return Globals.DatabaseVersion=='3' def show_class_id(self): return True
def class_id(self): def class_id(self):
return (self.getClassAttr('__module__','') or '')[1:] return (self.getClassAttr('__module__','') or '')[1:]
......
...@@ -126,12 +126,6 @@ def find_class(ob, name): ...@@ -126,12 +126,6 @@ def find_class(ob, name):
continue continue
raise AttributeError, name raise AttributeError, name
def dbVersionEquals(ver):
# A helper function to isolate db version checking.
return hasattr(Globals, 'DatabaseVersion') and \
Globals.DatabaseVersion == ver
bad_id=re.compile('[^a-zA-Z0-9_]').search bad_id=re.compile('[^a-zA-Z0-9_]').search
def manage_addZClass(self, id, title='', baseclasses=[], def manage_addZClass(self, id, title='', baseclasses=[],
...@@ -139,6 +133,7 @@ def manage_addZClass(self, id, title='', baseclasses=[], ...@@ -139,6 +133,7 @@ def manage_addZClass(self, id, title='', baseclasses=[],
zope_object=0): zope_object=0):
"""Add a Z Class """Add a Z Class
""" """
if bad_id(id) is not None: if bad_id(id) is not None:
raise BadRequest, ( raise BadRequest, (
'The id %s is invalid as a class name.' % id) 'The id %s is invalid as a class name.' % id)
...@@ -351,8 +346,6 @@ class ZClass( Base ...@@ -351,8 +346,6 @@ class ZClass( Base
changeClassId__roles__ = () # Private changeClassId__roles__ = () # Private
def changeClassId(self, newid=None): def changeClassId(self, newid=None):
if not dbVersionEquals('3'):
return
if newid is None: newid=self._new_class_id() if newid is None: newid=self._new_class_id()
self._unregister() self._unregister()
if newid: if newid:
...@@ -427,16 +420,12 @@ class ZClass( Base ...@@ -427,16 +420,12 @@ class ZClass( Base
self.propertysheets.methods.manage_afterClone(item) self.propertysheets.methods.manage_afterClone(item)
def manage_afterAdd(self, item, container): def manage_afterAdd(self, item, container):
if not dbVersionEquals('3'):
return
if not self._zclass_.__module__: if not self._zclass_.__module__:
self.setClassAttr('__module__', self._new_class_id()) self.setClassAttr('__module__', self._new_class_id())
self._register() self._register()
self.propertysheets.methods.manage_afterAdd(item, container) self.propertysheets.methods.manage_afterAdd(item, container)
def manage_beforeDelete(self, item, container): def manage_beforeDelete(self, item, container):
if not dbVersionEquals('3'):
return
self._unregister() self._unregister()
self.propertysheets.methods.manage_beforeDelete(item, container) self.propertysheets.methods.manage_beforeDelete(item, container)
......
...@@ -40,8 +40,6 @@ import ZPublisher ...@@ -40,8 +40,6 @@ import ZPublisher
def startup(): def startup():
global app global app
Globals.DatabaseVersion='3'
# Import products # Import products
OFS.Application.import_products() OFS.Application.import_products()
......
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