diff --git a/loops/organize/comment/README.txt b/loops/organize/comment/README.txt index 060571e..517db00 100644 --- a/loops/organize/comment/README.txt +++ b/loops/organize/comment/README.txt @@ -2,8 +2,6 @@ loops - Linked Objects for Organization and Processing Services =============================================================== - ($Id$) - Let's do some basic setup >>> from zope.app.testing.setup import placefulSetUp, placefulTearDown @@ -72,10 +70,10 @@ Viewing comments >>> items = list(comments.allItems()) >>> items [] + {'subject': 'My comment', 'text': 'Comment text'}>] >>> item = items[0] >>> item.subject, item.timeStamp, item.user['title'] - ('My comment', u'... ...', u'john') + ('My comment', '... ...', 'john') Reporting diff --git a/loops/organize/comment/base.py b/loops/organize/comment/base.py index d68c81a..1f94e6a 100644 --- a/loops/organize/comment/base.py +++ b/loops/organize/comment/base.py @@ -1,27 +1,10 @@ -# -# 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 -# +# loops.organize.comment.base -""" -Base classes for comments/discussions. +""" Base classes for comments/discussions. """ from zope.component import adapts -from zope.interface import implementer, implements +from zope.interface import implementer from zope.traversing.api import getParent from cybertools.stateful.definition import StatesDefinition @@ -46,10 +29,9 @@ def commentStates(): initialState='new') +@implementer(IComment) class Comment(Stateful, Track): - implements(IComment) - metadata_attributes = Track.metadata_attributes + ('state',) index_attributes = metadata_attributes typeName = 'Comment' diff --git a/loops/organize/comment/interfaces.py b/loops/organize/comment/interfaces.py index 687e8c4..cd08eb3 100644 --- a/loops/organize/comment/interfaces.py +++ b/loops/organize/comment/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 -# +# organize.comment.interfaces -""" -Interface definitions for comments - discussions - forums. +""" Interface definitions for comments - discussions - forums. """ from zope.interface import Interface, Attribute diff --git a/loops/organize/job/README.txt b/loops/organize/job/README.txt index cdc3122..6e59a17 100644 --- a/loops/organize/job/README.txt +++ b/loops/organize/job/README.txt @@ -2,8 +2,6 @@ loops - Linked Objects for Organization and Processing Services =============================================================== - ($Id$) - Let's do some basic setup >>> from zope.app.testing.setup import placefulSetUp, placefulTearDown @@ -57,7 +55,7 @@ the loops root object. >>> from loops.organize.job.base import JobManager >>> class Notifier(JobManager): ... def process(self): - ... print 'processing...' + ... print('processing...') >>> component.provideAdapter(Notifier, name='loops_notifier') >>> loopsRoot.options = ['organize.job.managers:loops_notifier'] diff --git a/loops/organize/stateful/README.txt b/loops/organize/stateful/README.txt index 641d206..04ce17d 100644 --- a/loops/organize/stateful/README.txt +++ b/loops/organize/stateful/README.txt @@ -146,8 +146,8 @@ The form view gives us access to the states of the object. ... sto = st.getStateObject() ... transitions = st.getAvailableTransitions() ... userTrans = st.getAvailableTransitionsForUser() - ... print st.statesDefinition, sto.title, [t.title for t in transitions], - ... print [t.title for t in userTrans] + ... print(st.statesDefinition, sto.title, [t.title for t in transitions], end=' ') + ... print([t.title for t in userTrans]) classification_quality unclassified ['classify', 'verify'] ['verify'] simple_publishing published ['retract', 'archive'] ['retract', 'archive'] @@ -169,8 +169,11 @@ Querying objects by state >>> from loops.organize.stateful.browser import StateQuery >>> view = StateQuery(stateQuery, TestRequest()) - >>> view.rcStatesDefinitions - {'concept': [], 'resource': [...StatesDefinition..., ...StatesDefinition...]} + >>> stdef = view.rcStatesDefinitions + >>> stdef['resource'] + [...StatesDefinition..., ...StatesDefinition...] + >>> stdef['concept'] + [] >>> input = {'state.resource.classification_quality': ['verified']} >>> view = StateQuery(stateQuery, TestRequest(form=input))