예제 #1
0
파일: uv_handle.py 프로젝트: gordol/lever
def Handle2_close(self):
    self.check_closed()
    ec = core.get_ec()
    if uv.is_closing(self.handle) == 0:
        uv.close(self.handle, _on_close_)
    # The call of _on_close_ is always deferred
    # to the next round of the event loop.
    return Event_wait(self.on_close)
예제 #2
0
파일: uv_handle.py 프로젝트: gordol/lever
 def getattr(self, name):
     if name == u"active":
         if self.closed:
             return false
         return boolean(uv.is_active(self.handle))
     if name == u"closing":
         if self.closed:
             return true
         return boolean(uv.is_closing(self.handle))
     if name == u"closed":
         return boolean(self.closed)
     if name == u"ref":
         if self.closed:
             return false
         return boolean(uv.has_ref(self.handle))
     if name == u"on_close":
         return self.on_close
     return Object.getattr(self, name)
예제 #3
0
파일: uv_handle.py 프로젝트: gordol/lever
 def getattr(self, name):
     if self.closed:
         raise unwind(LError(u"Handle is closed"))
     if name == u"active":
         if self.closed:
             return false
         return boolean(uv.is_active(self.handle))
     if name == u"closing":
         if self.closed:
             return true
         return boolean(uv.is_closing(self.handle))
     if name == u"closed":
         return boolean(self.closed)
     if name == u"ref":
         if self.closed:
             return false
         return boolean(uv.has_ref(self.handle))
     return Object.getattr(self, name)