Python socket 模块,_fileobject() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用socket._fileobject()

项目:oil    作者:oilshell    | 项目源码 | 文件源码
def testClose(self):
        class MockSocket:
            closed = False
            def flush(self): pass
            def close(self): self.closed = True

        # must not close unless we request it: the original use of _fileobject
        # by module socket requires that the underlying socket not be closed until
        # the _socketobject that created the _fileobject is closed
        s = MockSocket()
        f = socket._fileobject(s)
        f.close()
        self.assertTrue(not s.closed)

        s = MockSocket()
        f = socket._fileobject(s, close=True)
        f.close()
        self.assertTrue(s.closed)
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def testClose(self):
        class MockSocket:
            closed = False
            def flush(self): pass
            def close(self): self.closed = True

        # must not close unless we request it: the original use of _fileobject
        # by module socket requires that the underlying socket not be closed until
        # the _socketobject that created the _fileobject is closed
        s = MockSocket()
        f = socket._fileobject(s)
        f.close()
        self.assertTrue(not s.closed)

        s = MockSocket()
        f = socket._fileobject(s, close=True)
        f.close()
        self.assertTrue(s.closed)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def makefile(self, mode='r', bufsize=-1):

        """Make and return a file-like object that
        works with the SSL connection.  Just use the code
        from the socket module."""

        self._makefile_refs += 1
        # close=True so as to decrement the reference count when done with
        # the file-like object.
        return _fileobject(self, mode, bufsize, close=True)
项目:googletranslate.popclipext    作者:wizyoung    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:googletranslate.popclipext    作者:wizyoung    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:Projects    作者:it2school    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:Projects    作者:it2school    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:pip-update-requirements    作者:alanhamlett    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:pip-update-requirements    作者:alanhamlett    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:aws-waf-security-automation    作者:cerbo    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:code    作者:ActiveState    | 项目源码 | 文件源码
def setup(self):
        self.connection = self.request
        self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
        self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
项目:code    作者:ActiveState    | 项目源码 | 文件源码
def setup(self):
        self.connection = self.request
        self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
        self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
项目:electrum-martexcoin-server    作者:martexcoin    | 项目源码 | 文件源码
def setup(self):
        self.connection = self.request
        self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
        self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:workflows.kyoyue    作者:wizyoung    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:workflows.kyoyue    作者:wizyoung    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:zanph    作者:zanph    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:zanph    作者:zanph    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def makefile(self, mode='r', bufsize=-1):

        """Make and return a file-like object that
        works with the SSL connection.  Just use the code
        from the socket module."""

        self._makefile_refs += 1
        # close=True so as to decrement the reference count when done with
        # the file-like object.
        return _fileobject(self, mode, bufsize, close=True)
项目:YoWhenReady    作者:jnsdrtlf    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:azure-python-siteextensions    作者:Azure    | 项目源码 | 文件源码
def makefile(self, mode='r', bufsize=-1):

        """Make and return a file-like object that
        works with the SSL connection.  Just use the code
        from the socket module."""

        self._makefile_refs += 1
        # close=True so as to decrement the reference count when done with
        # the file-like object.
        return _fileobject(self, mode, bufsize, close=True)
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:purelove    作者:hucmosin    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:alexa-stackoverflow    作者:benvand    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:devsecops-example-helloworld    作者:boozallen    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:devsecops-example-helloworld    作者:boozallen    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:harbour-sailfinder    作者:DylanVanAssche    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:harbour-sailfinder    作者:DylanVanAssche    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:QXSConsolas    作者:qxsch    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:ascii-art-py    作者:blinglnav    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:Texty    作者:sarthfrey    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:ghostlines-robofont    作者:ghostlines    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:ghostlines-robofont    作者:ghostlines    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:lbryum-server    作者:lbryio    | 项目源码 | 文件源码
def setup(self):
        self.connection = self.request
        self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
        self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
项目:Dshield    作者:ywjt    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)
项目:atc_alexa    作者:ckuzma    | 项目源码 | 文件源码
def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)