!JiiOHXrIUCtcOJsZCa:matrix.org

nio

58 Members
The nio matrix python library | Latest release 0.6 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/31 Servers

Load older messages


Timestamp Message
14 Nov 2019
13:41:17@miruka:matrix.orgmiruka

but if there's tuples instead, e.g. [(1, None), (2, None), (None, "keys")], it's not so easy

13:44:07@poljar:matrix.orgpoljartrue
17:58:23@dylanvanassche:chat.dylanvanassche.bedylanvanassche joined the room.
19:32:12@dylanvanassche:dylanvanassche.beDylan Van Assche joined the room.
21:25:33@miruka:matrix.orgmirukacan we use aiofiles to handle Path objects/path strings as well for the encrypt and upload functions?
21:24:37@swedneck:permaweb.ioswedneck:permaweb.io changed their profile picture.
21:27:16@poljar:matrix.orgpoljarsure
15 Nov 2019
04:57:31@miruka:matrix.orgmiruka

where should a general util function go?

04:59:24@miruka:matrix.orgmiruka

I have a func that turns paths, file objects, normal iterables, etc into async iterables, to use from upload() and async_encrypt_attachment() that should be available even if encryption isn't

07:35:22@miruka:matrix.orgmiruka

After an hour of debugging, I found out that aioresponse doesn't do anything with the data parameter (https://docs.aiohttp.org/en/stable/client_quickstart.html#streaming-uploads), so it never calls my async generator which is responsible for catching the decryption dict too in the new AsyncClient.upload()

07:38:09@miruka:matrix.orgmirukaso it seems impossible to write a proper test for encrypted uploads
07:56:19@poljar:matrix.orgpoljarwe can add an utils.py file
07:56:53@poljar:matrix.orgpoljarhow do uploads work if it doesn't do anything with the data parameter?
07:59:47@miruka:matrix.orgmirukafrom what I see, aioresponse just ignores the actual upload part and returns a response with a content_uri in any case
08:01:11@miruka:matrix.orgmirukawhere the real aiohttp functions would iterate the data generator to upload the chunks
08:04:49@poljar:matrix.orgpoljari guess we can live without one test, just make sure to test it manually well
17 Nov 2019
15:33:18@miruka:matrix.orgmiruka

Is there a way to see locally the test coverage and which lines aren't tested, without having to push and wait for the codecov bot?

15:52:20@poljar:matrix.orgpoljar the coverage target of the makefile does that; you'll need pytest-cov
15:52:49@poljar:matrix.orgpoljar or python -m pytest --cov nio
16:21:34@miruka:matrix.orgmirukathanks
18:35:46@cos:hacklab.ficosis there any bot template git repository for writing own bots or is it recommended to start from scratch and use the lib directly?
18:36:20@dylanvanassche:dylanvanassche.beDylan Van Assche changed their display name from dylanvanassche to Dylan Van Assche.
18:37:15@dylanvanassche:dylanvanassche.beDylan Van Assche set a profile picture.
18:38:48@andrewm:amorgan.xyzanoa
In reply to @cos:hacklab.fi
is there any bot template git repository for writing own bots or is it recommended to start from scratch and use the lib directly?
https://github.com/anoadragon453/nio-template
18:48:50@cos:hacklab.ficoshm, looks way too complex for my purposes. i think i'll use the api directly.
19:05:52@cos:hacklab.ficosthe example bot seems to send bunch of old messages. should i set the read markers in each room to latest message to receive only new messages?
19:16:24@andrewm:amorgan.xyzanoaYou need to save the sync token.
19:16:39@andrewm:amorgan.xyzanoaElse it'll just be grabbing the X latest messages in each room.
19:16:54@andrewm:amorgan.xyzanoaThe sync token tells the server at what point you'll sync'd up to.
19:20:02@cos:hacklab.ficosI don't want to save any data in the bot, but i suppose i can ignore old messages by just ignoring all events in first sync.

There are no newer messages yet.


Back to Room List