[Checkins] SVN: zc.objectlog/trunk/ remove dependency on zc.security

Gary Poster gary at zope.com
Fri May 16 20:08:59 EDT 2008


Log message for revision 86812:
  remove dependency on zc.security

Changed:
  _U  zc.objectlog/trunk/
  U   zc.objectlog/trunk/README.txt
  U   zc.objectlog/trunk/buildout.cfg
  U   zc.objectlog/trunk/setup.py
  D   zc.objectlog/trunk/src/zc/objectlog/DEPENDENCIES.cfg
  U   zc.objectlog/trunk/src/zc/objectlog/interfaces.py
  U   zc.objectlog/trunk/src/zc/objectlog/log.txt
  U   zc.objectlog/trunk/src/zc/objectlog/tests.py

-=-

Property changes on: zc.objectlog/trunk
___________________________________________________________________
Name: svn:ignore
   + develop-eggs
bin
parts
.installed.cfg
dist
TEST_THIS_REST_BEFORE_REGISTERING.txt
*.kpf

Name: svn:externals
   + bootstrap svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap


Modified: zc.objectlog/trunk/README.txt
===================================================================
--- zc.objectlog/trunk/README.txt	2008-05-16 23:48:51 UTC (rev 86811)
+++ zc.objectlog/trunk/README.txt	2008-05-17 00:08:58 UTC (rev 86812)
@@ -1,21 +1 @@
-The objectlog package provides a customizable log for a single object.  The
-system was designed to provide information for a visual log of important
-object changes and to provide analyzable information for metrics.
-
-- It provides automatic recording for each log entry of a timestamp and the
-  principals in the request when the log was made.
-
-- Given a schema of data to collect about the object, it automatically
-  calculates and stores changesets from the last log entry, primarily to
-  provide a quick and easy answer to the question "what changed?" and
-  secondarily to reduce database size.
-
-- It accepts optional summary and detail values that allow the system or users
-  to annotate the entries with human-readable messages.
-
-- It allows each log entry to be annotated with zero or more marker interfaces
-  so that log entries may be classified with an interface.
-
-For more information about using zc.objectlog, see:
-
-    src/zc/objectlog/log.txt
+a customizable log for a single object in Zope 3.
\ No newline at end of file

Modified: zc.objectlog/trunk/buildout.cfg
===================================================================
--- zc.objectlog/trunk/buildout.cfg	2008-05-16 23:48:51 UTC (rev 86811)
+++ zc.objectlog/trunk/buildout.cfg	2008-05-17 00:08:58 UTC (rev 86812)
@@ -1,6 +1,6 @@
 [buildout]
 develop = .
-parts = script
+parts = script 
 
 [test]
 recipe = zc.recipe.testrunner
@@ -11,4 +11,5 @@
 [script]
 recipe = zc.recipe.egg
 eggs = ${test:eggs}
-interpreter = py
+       docutils
+interpreter = py
\ No newline at end of file

Modified: zc.objectlog/trunk/setup.py
===================================================================
--- zc.objectlog/trunk/setup.py	2008-05-16 23:48:51 UTC (rev 86811)
+++ zc.objectlog/trunk/setup.py	2008-05-17 00:08:58 UTC (rev 86812)
@@ -1,18 +1,87 @@
+##############################################################################
+#
+# Copyright (c) 2006-2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
 import os
 from setuptools import setup, find_packages
 
+# generic helpers primarily for the long_description
+try:
+    import docutils
+except ImportError:
+    import warnings
+    def validateReST(text):
+        return ''
+else:
+    import docutils.utils
+    import docutils.parsers.rst
+    import StringIO
+    def validateReST(text):
+        doc = docutils.utils.new_document('validator')
+        # our desired settings
+        doc.reporter.halt_level = 5
+        doc.reporter.report_level = 1
+        stream = doc.reporter.stream = StringIO.StringIO()
+        # docutils buglets (?)
+        doc.settings.tab_width = 2
+        doc.settings.pep_references = doc.settings.rfc_references = False
+        doc.settings.trim_footnote_reference_space = None
+        # and we're off...
+        parser = docutils.parsers.rst.Parser()
+        parser.parse(text, doc)
+        return stream.getvalue()
+
+def text(*args, **kwargs):
+    # note: distutils explicitly disallows unicode for setup values :-/
+    # http://docs.python.org/dist/meta-data.html
+    tmp = []
+    for a in args:
+        if a.endswith('.txt'):
+            f = open(os.path.join(*a.split('/')))
+            tmp.append(f.read())
+            f.close()
+            tmp.append('\n\n')
+        else:
+            tmp.append(a)
+    if len(tmp) == 1:
+        res = tmp[0]
+    else:
+        res = ''.join(tmp)
+    out = kwargs.get('out')
+    if out is True:
+        out = 'TEST_THIS_REST_BEFORE_REGISTERING.txt'
+    if out:
+        f = open(out, 'w')
+        f.write(res)
+        f.close()
+        report = validateReST(res)
+        if report:
+            print report
+            raise ValueError('ReST validation error')
+    return res
+# end helpers; below this line should be code custom to this package
+
 long_description = (open("README.txt").read() +
                     '\n\n' +
                     open(os.path.join("src","zc","objectlog","log.txt")).read())
 
 setup(
     name="zc.objectlog",
-    version="0.1.2dev",
+    version="0.1.3b1",
     license="ZPL 2.1",
-    author="Zope Corporation",
-    author_email="zope-dev at zope.org",
-    description='Customizable object log for Zope3',
-    long_description=long_description,
+    author="Gary Poster",
+    author_email="gary at zope.com",
+    description=open("README.txt").read(),
+    long_description=text('src/zc/objectlog/log.txt'),
     keywords="zope zope3 logging",
     packages=find_packages('src'),
     package_dir={'':'src'},
@@ -21,7 +90,6 @@
     install_requires = [
         'setuptools',
         'zc.copy',
-        'zc.security',
         'zope.app.keyreference',
     ],
     zip_safe = False

Deleted: zc.objectlog/trunk/src/zc/objectlog/DEPENDENCIES.cfg
===================================================================
--- zc.objectlog/trunk/src/zc/objectlog/DEPENDENCIES.cfg	2008-05-16 23:48:51 UTC (rev 86811)
+++ zc.objectlog/trunk/src/zc/objectlog/DEPENDENCIES.cfg	2008-05-17 00:08:58 UTC (rev 86812)
@@ -1 +0,0 @@
-zc.security

Modified: zc.objectlog/trunk/src/zc/objectlog/interfaces.py
===================================================================
--- zc.objectlog/trunk/src/zc/objectlog/interfaces.py	2008-05-16 23:48:51 UTC (rev 86811)
+++ zc.objectlog/trunk/src/zc/objectlog/interfaces.py	2008-05-17 00:08:58 UTC (rev 86812)
@@ -18,10 +18,9 @@
 """
 from zope import interface, schema
 import zope.interface.common.sequence
+import zope.interface.common.mapping
 import zope.component.interfaces
 
-from zc.security.search import SimplePrincipalSource
-
 from i18n import _
 
 class ILog(zope.interface.common.sequence.IFiniteSequence):
@@ -90,8 +89,7 @@
         required=True, readonly=True)
 
     principal_ids = schema.Tuple(
-        value_type=schema.Choice(
-            source=SimplePrincipalSource()),
+        value_type=schema.TextLine(),
         title=_("Principals"),
         description=_(
             """The ids of the principals who triggered this log entry"""),

Modified: zc.objectlog/trunk/src/zc/objectlog/log.txt
===================================================================
--- zc.objectlog/trunk/src/zc/objectlog/log.txt	2008-05-16 23:48:51 UTC (rev 86811)
+++ zc.objectlog/trunk/src/zc/objectlog/log.txt	2008-05-17 00:08:58 UTC (rev 86812)
@@ -35,7 +35,7 @@
     >>> class DummyPrincipal(object):
     ...     interface.implements(zope.security.interfaces.IPrincipal)
     ...     def __init__(self, id, title, description):
-    ...         self.id = id
+    ...         self.id = unicode(id)
     ...         self.title = title
     ...         self.description = description
     ...
@@ -124,7 +124,7 @@
     >>> entry.timestamp.tzinfo is pytz.utc
     True
     >>> entry.principal_ids
-    ('alice',)
+    (u'alice',)
     >>> list(emily.log) == [entry]
     True
     >>> entry.record_schema is ICat
@@ -199,7 +199,7 @@
     >>> after <= emily.log[1].timestamp <= datetime.datetime.now(pytz.utc)
     True
     >>> emily.log[1].principal_ids # cathy was not a request, so not included
-    ('alice', 'betty')
+    (u'alice', u'betty')
     >>> emily.log[1].details
     u'Dry food,\nin fact.'
     >>> emily.log[1].record_changes
@@ -253,7 +253,7 @@
     ...     emily.log[3]]
     True
     >>> emily.log[3].principal_ids
-    ('cathy',)
+    (u'cathy',)
     >>> emily.log[3].record_changes=={'weight': 17, 'location': None}
     True
     >>> record = emily.log[3].record

Modified: zc.objectlog/trunk/src/zc/objectlog/tests.py
===================================================================
--- zc.objectlog/trunk/src/zc/objectlog/tests.py	2008-05-16 23:48:51 UTC (rev 86811)
+++ zc.objectlog/trunk/src/zc/objectlog/tests.py	2008-05-17 00:08:58 UTC (rev 86812)
@@ -45,7 +45,7 @@
     class DummyPrincipal(object):
         interface.implements(zope.security.interfaces.IPrincipal)
         def __init__(self, id, title, description):
-            self.id = id
+            self.id = unicode(id)
             self.title = title
             self.description = description
     



More information about the Checkins mailing list