Get class in Python decorator
<p>In this code:</p>

<pre><code>def online_only(func, self):
    def f(*args, **kwargs):
        if self.running:
            return func(*args, **kwargs)
        else:
            return False
    return f
class VM(object):
   @property
   def running(self):
       return True
   @property
   @online_only
   def diskinfo(self):
       return True
</code></pre>

<p>I want diskinfo to run only when VM.running returned True. How can I get online_only to be able to read self.running?</p>
