How to use the aioftp.ConnectionConditions function in aioftp

To help you get started, we’ve selected a few aioftp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / aioftp / tests / test-extra.py View on Github external
        aioftp.ConnectionConditions.passive_server_started)
    async def coll(self, connection, rest):

        @aioftp.ConnectionConditions(
            aioftp.ConnectionConditions.data_connection_made,
            wait=True,
            fail_code="425",
            fail_info="Can't open data connection")
        @aioftp.server.worker
        async def coll_worker(self, connection, rest):

            stream = connection.data_connection
            del connection.data_connection

            async with stream:

                for i in range(count):
github aio-libs / aioftp / tests / test-extra.py View on Github external
    @aioftp.ConnectionConditions(
        aioftp.ConnectionConditions.login_required,
        aioftp.ConnectionConditions.passive_server_started)
    async def coll(self, connection, rest):

        @aioftp.ConnectionConditions(
            aioftp.ConnectionConditions.data_connection_made,
            wait=True,
            fail_code="425",
            fail_info="Can't open data connection")
        @aioftp.server.worker
        async def coll_worker(self, connection, rest):

            stream = connection.data_connection
            del connection.data_connection

            async with stream:
github aio-libs / aioftp / tests / test-extra.py View on Github external
        aioftp.ConnectionConditions.login_required,
        aioftp.ConnectionConditions.passive_server_started)
    async def coll(self, connection, rest):

        @aioftp.ConnectionConditions(
            aioftp.ConnectionConditions.data_connection_made,
            wait=True,
            fail_code="425",
            fail_info="Can't open data connection")
        @aioftp.server.worker
        async def coll_worker(self, connection, rest):

            stream = connection.data_connection
            del connection.data_connection

            async with stream:
github aio-libs / aioftp / tests / test-extra.py View on Github external
            aioftp.ConnectionConditions.data_connection_made,
            wait=True,
            fail_code="425",
            fail_info="Can't open data connection")
        @aioftp.server.worker
        async def coll_worker(self, connection, rest):

            stream = connection.data_connection
            del connection.data_connection

            async with stream:

                for i in range(count):

                    await stream.write(str.encode(str(i) + "\n"))

            connection.response("200", "coll transfer done")
github aio-libs / aioftp / tests / test-extra.py View on Github external
        @aioftp.ConnectionConditions(
            aioftp.ConnectionConditions.data_connection_made,
            wait=True,
            fail_code="425",
            fail_info="Can't open data connection")
        @aioftp.server.worker
        async def coll_worker(self, connection, rest):

            stream = connection.data_connection
            del connection.data_connection

            async with stream:

                for i in range(count):

                    await stream.write(str.encode(str(i) + "\n"))