Testing of project tree rewriting

This commit is contained in:
hakril
2015-12-30 22:49:34 +01:00
parent c8bf7d04f8
commit 28eb4df2d0
45 changed files with 0 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
"""utils fonctions non windows-related"""
import ctypes
def fixedpropety(f):
cache_name = "_" + f.__name__
def prop(self):
try:
return getattr(self, cache_name)
except AttributeError:
setattr(self, cache_name, f(self))
return getattr(self, cache_name)
return property(prop, doc=f.__doc__)
def swallow_ctypes_copy(ctypes_object):
new_copy = type(ctypes_object)()
ctypes.memmove(ctypes.byref(new_copy), ctypes.byref(ctypes_object), ctypes.sizeof(new_copy))
return new_copy