~ibmcharmers/charms/xenial/ibm-cinder-storwize-svc/trunk

« back to all changes in this revision

Viewing changes to .tox/py35/lib/python3.5/site-packages/wheel/decorator.py

  • Committer: Ankammarao
  • Date: 2017-03-06 05:11:42 UTC
  • Revision ID: achittet@in.ibm.com-20170306051142-dpg27z4es1k56hfn
Marked tests folder executable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# from Pyramid
 
2
 
 
3
 
 
4
class reify(object):
 
5
    """Put the result of a method which uses this (non-data)
 
6
    descriptor decorator in the instance dict after the first call,
 
7
    effectively replacing the decorator with an instance variable.
 
8
    """
 
9
 
 
10
    def __init__(self, wrapped):
 
11
        self.wrapped = wrapped
 
12
        self.__doc__ = wrapped.__doc__
 
13
 
 
14
    def __get__(self, inst, objtype=None):
 
15
        if inst is None:
 
16
            return self
 
17
        val = self.wrapped(inst)
 
18
        setattr(inst, self.wrapped.__name__, val)
 
19
        return val