Ticket #5451: patch_5451.patch
| File patch_5451.patch, 5.1 KB (added by moijes12, 16 months ago) |
|---|
-
twisted/python/reflect.py
33 33 from twisted.python.deprecate import deprecated 34 34 from twisted.python.deprecate import _fullyQualifiedName as fullyQualifiedName 35 35 from twisted.python.versions import Version 36 from twisted.python import deprecate 36 37 37 38 38 39 … … 44 45 where you don't want to name a variable, but you do want to set 45 46 some attributes; for example, C{X()(y=z,a=b)}. 46 47 """ 48 49 deprecate.deprecatedModuleAttribute(Version("Twisted", 12, 1, 0), "", "twisted.python.reflect", "Settable") 50 47 51 def __init__(self, **kw): 48 52 self(**kw) 49 53 … … 75 79 76 80 """ 77 81 82 deprecate.deprecatedModuleAttribute(Version("Twisted", 12, 1, 0), "", "twisted.python.reflect", "AccessorType") 83 78 84 def __init__(self, name, bases, d): 79 85 type.__init__(self, name, bases, d) 80 86 accessors = {} … … 138 144 # caused by it. 139 145 # -- itamar 140 146 147 deprecate.deprecatedModuleAttribute(Version("Twisted", 12, 1, 0), "", "twisted.python.reflect", "PropertyAccessor") 141 148 __metaclass__ = AccessorType 142 149 143 150 def reallySet(self, k, v): … … 159 166 This implementation is for Python 2.1. 160 167 """ 161 168 169 deprecate.deprecatedModuleAttribute(Version("Twisted", 12, 1, 0), "", "twisted.python.reflect", "Accessor") 170 162 171 def __setattr__(self, k,v): 163 172 kstring='set_%s'%k 164 173 if hasattr(self.__class__,kstring): … … 199 208 200 209 # just in case 201 210 OriginalAccessor = Accessor 202 211 deprecate.deprecatedModuleAttribute(Version("Twisted", 12, 1, 0), "", "twisted.python.reflect", "OriginalAccessor") 203 212 204 213 class Summer(Accessor): 205 214 """ … … 214 223 incremented, similiarly for the debit versions. 215 224 """ 216 225 226 deprecate.deprecatedModuleAttribute(Version("Twisted", 12, 1, 0), "", "twisted.python.reflect", "Summer") 227 217 228 def reallySet(self, k,v): 218 229 "This method does the work." 219 230 for sum in self.sums: -
twisted/topfiles/5451.removal
1 twisted.python.reflect's Settable, AccessorType, PropertyAccessor, Accessor, OriginalAccessor and Summer are now deprecated. 2 No newline at end of file -
twisted/test/test_reflect.py
781 781 self.callDeprecated( 782 782 (Version("Twisted", 11, 0, 0), "inspect.getmro"), 783 783 reflect.accumulateBases, DeprecationTestCase, l, None) 784 785 def test_settable(self): 786 """ 787 Test deprecation of L{reflect.Settable} 788 """ 789 settable = reflect.Settable() 790 warnings = self.flushWarnings([self.test_settable]) 791 self.assertSubstring("twisted.python.reflect.Settable was deprecated in Twisted 12.1.0", warnings[0]['message']) 792 self.assertEqual(len(warnings),1) 793 794 def test_accessorType(self): 795 """ 796 Test deprecation of L{reflect.AccessorType} 797 """ 798 accessorType = reflect.AccessorType('', (), {}) 799 warnings = self.flushWarnings([self.test_accessorType]) 800 self.assertSubstring("twisted.python.reflect.AccessorType was deprecated in Twisted 12.1.0", warnings[0]['message']) 801 self.assertEqual(len(warnings),1) 802 803 def test_propertyAccessor(self): 804 """ 805 Test deprecation of L{reflect.PropertyAccessor} 806 """ 807 accessorType = reflect.PropertyAccessor() 808 warnings = self.flushWarnings([self.test_propertyAccessor]) 809 self.assertSubstring("twisted.python.reflect.PropertyAccessor was deprecated in Twisted 12.1.0", warnings[0]['message']) 810 self.assertEqual(len(warnings),1) 811 812 def test_accessor(self): 813 """ 814 Test deprecation of L{reflect.Accessor} 815 """ 816 accessorType = reflect.Accessor() 817 warnings = self.flushWarnings([self.test_accessor]) 818 self.assertSubstring("twisted.python.reflect.Accessor was deprecated in Twisted 12.1.0", warnings[0]['message']) 819 self.assertEqual(len(warnings),1) 820 821 def test_originalAccessor(self): 822 """ 823 Test deprecation of L{reflect.OriginalAccessor} 824 """ 825 from twisted.python.reflect import OriginalAccessor 826 warnings = self.flushWarnings([self.test_originalAccessor]) 827 self.assertSubstring("twisted.python.reflect.OriginalAccessor was deprecated in Twisted 12.1.0", warnings[0]['message']) 828 self.assertEqual(len(warnings),1) 829 830 def test_summer(self): 831 """ 832 Test deprecation of L{reflect.Summer} 833 """ 834 accessorType = reflect.Summer() 835 warnings = self.flushWarnings([self.test_summer]) 836 self.assertSubstring("twisted.python.reflect.Summer was deprecated in Twisted 12.1.0", warnings[0]['message']) 837 self.assertEqual(len(warnings),1) 838 No newline at end of file
