[Checkins] SVN: zc.freeze/trunk/s Removed the included rwproperty, added a dependency, bumped the version.

Albertas Agejevas alga at pov.lt
Wed Jul 4 14:56:23 EDT 2007


Log message for revision 77423:
  Removed the included rwproperty, added a dependency, bumped the version.
  

Changed:
  U   zc.freeze/trunk/setup.py
  A   zc.freeze/trunk/src/zc/freeze/CHANGES.txt
  U   zc.freeze/trunk/src/zc/freeze/README.txt
  U   zc.freeze/trunk/src/zc/freeze/__init__.py
  D   zc.freeze/trunk/src/zc/freeze/rwproperty.py

-=-
Modified: zc.freeze/trunk/setup.py
===================================================================
--- zc.freeze/trunk/setup.py	2007-07-04 18:01:51 UTC (rev 77422)
+++ zc.freeze/trunk/setup.py	2007-07-04 18:56:22 UTC (rev 77423)
@@ -2,8 +2,8 @@
 
 setup(
     name="zc.freeze",
-    version="1.0",
-    install_requires=['zc.copy'],
+    version="1.0.1",
+    install_requires=['zc.copy', 'rwproperty'],
 #    dependency_links=['http://download.zope.org/distribution/',],
     packages=find_packages('src'),
     include_package_data=True,

Added: zc.freeze/trunk/src/zc/freeze/CHANGES.txt
===================================================================
--- zc.freeze/trunk/src/zc/freeze/CHANGES.txt	                        (rev 0)
+++ zc.freeze/trunk/src/zc/freeze/CHANGES.txt	2007-07-04 18:56:22 UTC (rev 77423)
@@ -0,0 +1,9 @@
+=======
+CHANGES
+=======
+
+1.0.1
+=====
+
+Removed the included rwproperty.py and added a dependency instead, as
+rwproperty is now available from pypi.


Property changes on: zc.freeze/trunk/src/zc/freeze/CHANGES.txt
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: zc.freeze/trunk/src/zc/freeze/README.txt
===================================================================
--- zc.freeze/trunk/src/zc/freeze/README.txt	2007-07-04 18:01:51 UTC (rev 77422)
+++ zc.freeze/trunk/src/zc/freeze/README.txt	2007-07-04 18:56:22 UTC (rev 77423)
@@ -130,8 +130,7 @@
 
 'setproperty' and 'delproperty' functions can generate a freeze-aware
 descriptor that raises a FrozenError if the set or del methods are called
-on a frozen object.  These are rwproperties (see rwproperty.txt; imported
-from another project.)
+on a frozen object.  These are rwproperties.
 
 'makeProperty' generates a freeze-aware descriptor that does a simple
 get/set but raises FrozenError if the set is attempted on a frozen

Modified: zc.freeze/trunk/src/zc/freeze/__init__.py
===================================================================
--- zc.freeze/trunk/src/zc/freeze/__init__.py	2007-07-04 18:01:51 UTC (rev 77422)
+++ zc.freeze/trunk/src/zc/freeze/__init__.py	2007-07-04 18:56:22 UTC (rev 77423)
@@ -7,8 +7,7 @@
 from zope.cachedescriptors.property import Lazy
 
 from zc.freeze import interfaces
-# import rwproperty
-from zc.freeze import rwproperty
+import rwproperty
 
 def method(f):
     def wrapper(self, *args, **kwargs):

Deleted: zc.freeze/trunk/src/zc/freeze/rwproperty.py
===================================================================
--- zc.freeze/trunk/src/zc/freeze/rwproperty.py	2007-07-04 18:01:51 UTC (rev 77422)
+++ zc.freeze/trunk/src/zc/freeze/rwproperty.py	2007-07-04 18:56:22 UTC (rev 77423)
@@ -1,75 +0,0 @@
-# Read & write properties
-#
-# Copyright (c) 2006 by Philipp "philiKON" von Weitershausen
-#                       philikon at philikon.de
-#
-# Freely distributable under the terms of the Zope Public License, v2.1.
-#
-# See rwproperty.txt for detailed explanations
-#
-import sys
-
-__all__ = ['getproperty', 'setproperty', 'delproperty']
-
-class rwproperty(object):
-
-    def __new__(cls, func):
-        name = func.__name__
-
-        # ugly, but common hack
-        frame = sys._getframe(1)
-        locals = frame.f_locals
-
-        if name not in locals:
-            return cls.createProperty(func)
-
-        oldprop = locals[name]
-        if isinstance(oldprop, property):
-            return cls.enhanceProperty(oldprop, func)
-
-        raise TypeError("read & write properties cannot be mixed with "
-                        "other attributes except regular property objects.")
-
-    # this might not be particularly elegant, but it's easy on the eyes
-
-    @staticmethod
-    def createProperty(func):
-        raise NotImplementedError
-
-    @staticmethod
-    def enhanceProperty(oldprop, func):
-        raise NotImplementedError
-
-class getproperty(rwproperty):
-
-    @staticmethod
-    def createProperty(func):
-        return property(func)
-
-    @staticmethod
-    def enhanceProperty(oldprop, func):
-        return property(func, oldprop.fset, oldprop.fdel)
-
-class setproperty(rwproperty):
-
-    @staticmethod
-    def createProperty(func):
-        return property(None, func)
-
-    @staticmethod
-    def enhanceProperty(oldprop, func):
-        return property(oldprop.fget, func, oldprop.fdel)
-
-class delproperty(rwproperty):
-
-    @staticmethod
-    def createProperty(func):
-        return property(None, None, func)
-
-    @staticmethod
-    def enhanceProperty(oldprop, func):
-        return property(oldprop.fget, oldprop.fset, func)
-
-if __name__ == "__main__":
-    import doctest
-    doctest.testfile('rwproperty.txt')



More information about the Checkins mailing list