~anitanayak/charms/trusty/ibm-wxs-catalog/ibm-wxs-catalog-branch

« back to all changes in this revision

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

  • Committer: Anita Nayak
  • Date: 2016-10-21 09:34:00 UTC
  • Revision ID: anitanayak@in.ibm.com-20161021093400-fv05mg22l496a0l6
lint fix-in for IBM WXS Catalog

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