From 33ab512b7f296eb97a8d0dc7f231e71f9c4c7a1a Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 26 Sep 2024 16:24:24 +0200 Subject: [PATCH] some more Python3 fixes (composer.report, tracking) --- cybertools/composer/report/field.py | 4 ++-- cybertools/tracking/comment/interfaces.py | 25 +++-------------------- cybertools/tracking/interfaces.py | 21 ++----------------- 3 files changed, 7 insertions(+), 43 deletions(-) diff --git a/cybertools/composer/report/field.py b/cybertools/composer/report/field.py index cd16434..c57e263 100644 --- a/cybertools/composer/report/field.py +++ b/cybertools/composer/report/field.py @@ -105,8 +105,8 @@ class Field(Component): def getValue(self, row): value = self.getRawValue(row) if value is None: - return u'' - if isinstance(value, basestring): + return '' + if isinstance(value, str): return value return getattr(value, 'title', str(value)) diff --git a/cybertools/tracking/comment/interfaces.py b/cybertools/tracking/comment/interfaces.py index be9b750..7863353 100644 --- a/cybertools/tracking/comment/interfaces.py +++ b/cybertools/tracking/comment/interfaces.py @@ -1,25 +1,6 @@ -# -# Copyright (c) 2008 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# cybertools.tracking.comment.interfaces -""" -Interface definitions for comments - discussions - forums. - -$Id$ +""" Interface definitions for comments - discussions - forums. """ from zope.interface import Interface, Attribute @@ -55,7 +36,7 @@ class IComment(ITrack): title=u'Content Type', description=u'Content type (format) of the text field', # TODO: provide a source/vocabulary - default='text/restructured', + default=b'text/restructured', required=True) def getChildren(sort='default'): diff --git a/cybertools/tracking/interfaces.py b/cybertools/tracking/interfaces.py index 8e37e14..e166d7e 100644 --- a/cybertools/tracking/interfaces.py +++ b/cybertools/tracking/interfaces.py @@ -1,23 +1,6 @@ -# -# Copyright (c) 2014 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# cybertools.tracking.interfaces -""" -Interface definitions for tracking of user interactions. +""" Interface definitions for tracking of user interactions. """ from zope.interface import Interface, Attribute