From 64ad40fb96014766066025f5f6162b16b2dbf2f7 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 3 Jan 2024 16:57:47 +0100 Subject: [PATCH] clean-up source files --- organize/personal/browser/favorite.py | 21 ++----------------- organize/personal/favorite.py | 29 ++++++--------------------- util.py | 21 ++----------------- 3 files changed, 10 insertions(+), 61 deletions(-) diff --git a/organize/personal/browser/favorite.py b/organize/personal/browser/favorite.py index 31a114c..213af77 100644 --- a/organize/personal/browser/favorite.py +++ b/organize/personal/browser/favorite.py @@ -1,23 +1,6 @@ -# -# Copyright (c) 2016 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 -# +# loops.organize.personal.browser -""" -A view (to be used by listings, portlets, ...) for favorites. +"""A view (to be used by listings, portlets, ...) for favorites. """ from zope import component diff --git a/organize/personal/favorite.py b/organize/personal/favorite.py index e1d27a6..6df78ad 100644 --- a/organize/personal/favorite.py +++ b/organize/personal/favorite.py @@ -1,27 +1,10 @@ -# -# Copyright (c) 2015 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 -# +# loops.organize.personal.favorite -""" -A framework for storing personal favorites and settings. +"""A framework for storing personal favorites and settings. """ from zope.component import adapts -from zope.interface import implements +from zope.interface import implementer from cybertools.util.date import date2TimeStamp from cybertools.tracking.btree import Track @@ -30,9 +13,9 @@ from loops.organize.personal.interfaces import IFavorites, IFavorite from loops import util +@implementer(IFavorites) class Favorites(object): - implements(IFavorites) adapts(ITrackingStorage) def __init__(self, context): @@ -98,10 +81,9 @@ class Favorites(object): self.context.setTrackData(track, data) +@implementer(IFavorite) class BaseFavorite(object): - implements(IFavorite) - typeName = 'Favorite' @property @@ -116,6 +98,7 @@ class Favorite(BaseFavorite, Track): def updateSortInfo(person, task, data): if person is not None: favorites = task.getLoopsRoot().getRecordManager().get('favorites') + #favorites = util.records(task, 'favorites', FavContainer) if favorites is None: return data personUid = util.getUidForObject(person) diff --git a/util.py b/util.py index cf3a656..5e3f558 100644 --- a/util.py +++ b/util.py @@ -1,23 +1,6 @@ -# -# Copyright (c) 2017 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 -# +# loops.util -""" -Utility functions. +"""Utility functions. """ from __future__ import absolute_import