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

Removed BoboPOS compatibility code.

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