Exemplo n.º 1
0
Arquivo: files.py Projeto: dckc/typhon
    def succeed(self):
        # Clean up libuv stuff.
        ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)

        # Finally, resolve.
        buf = "".join(self.pieces)
        self.resolver.resolve(BytesObject(buf))
Exemplo n.º 2
0
    def succeed(self):
        # Clean up libuv stuff.
        ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)

        # Finally, resolve.
        buf = "".join(self.pieces)
        self.resolver.resolve(BytesObject(buf))
Exemplo n.º 3
0
 def written(self, size):
     self.pos += size
     self.data = self.data[size:]
     if self.data:
         self.queueWrite()
     else:
         # Finished writing; let's move on to the rename.
         ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, closeSetContentsCB)
Exemplo n.º 4
0
Arquivo: files.py Projeto: dckc/typhon
 def written(self, size):
     self.pos += size
     self.data = self.data[size:]
     if self.data:
         self.queueWrite()
     else:
         # Finished writing; let's move on to the rename.
         ruv.fsClose(self.vat.uv_loop, self.fs, self.fd,
                     closeSetContentsCB)
Exemplo n.º 5
0
Arquivo: files.py Projeto: dckc/typhon
    def fail(self, reason):
        # Clean up libuv stuff.
        ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)

        # And resolve.
        self.resolver.smash(StrObject(u"libuv error: %s" % reason))
Exemplo n.º 6
0
Arquivo: files.py Projeto: dckc/typhon
 def queueClose(self):
     ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)
     self._state = self.CLOSED
Exemplo n.º 7
0
Arquivo: files.py Projeto: dckc/typhon
 def close(self):
     uv_loop = self.vat.uv_loop
     ruv.fsClose(uv_loop, self.fs, self.fd, ruv.fsDiscard)
     ruv.freeBuf(self.buf)
     self.drain = None
Exemplo n.º 8
0
 def _cleanup(self):
     fs = ruv.alloc_fs()
     ruv.stashFS(fs, (self._vat, self))
     ruv.fsClose(self._vat.uv_loop, fs, self._fd, ruv.fsUnstashAndDiscard)
     self.closed = True
Exemplo n.º 9
0
 def _cleanup(self):
     uv_loop = self._vat.uv_loop
     fs = ruv.alloc_fs()
     ruv.stashFS(fs, (self._vat, self))
     ruv.fsClose(uv_loop, fs, self._fd, ruv.fsUnstashAndDiscard)
     ruv.freeBuf(self._buf)
Exemplo n.º 10
0
    def fail(self, reason):
        # Clean up libuv stuff.
        ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)

        # And resolve.
        self.resolver.smash(StrObject(u"libuv error: %s" % reason))
Exemplo n.º 11
0
 def queueClose(self):
     ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)
     self._state = self.CLOSED
Exemplo n.º 12
0
 def close(self):
     uv_loop = self.vat.uv_loop
     ruv.fsClose(uv_loop, self.fs, self.fd, ruv.fsDiscard)
     ruv.freeBuf(self.buf)
     self.drain = None
Exemplo n.º 13
0
 def _cleanup(self):
     ruv.fsClose(self._vat.uv_loop, self._fs, self._fd, ruv.fsDiscard)
     self.closed = True
Exemplo n.º 14
0
 def _cleanup(self):
     uv_loop = self._vat.uv_loop
     ruv.fsClose(uv_loop, self._fs, self._fd, ruv.fsDiscard)
     ruv.freeBuf(self._buf)