Age | Commit message (Collapse) | Author |
|
|
|
Introduce the concept of priority for event handlers, instead of the
position parameter.
The new `priority` parameter replacing `position` should be an integer
between 0 and 100. It defaults to 50.
The previous `position` parameter was only used to insert at a certain
position in the list of handlers (for this particular event). No
reference of it was kept, which means that it was not possible to ensure
an event was called in the position is was supposed to be.
I am now using per-event dicts, containing priority buckets (lists) of
handlers. I am using OrderedDicts to make it easier to loop through all
of the handlers, as insertion happens less often than reading.
I was also suggested using bisect with a simple list of tuples
(priority, handler) per event, but bisect tries to compare bound
methods, which is obviously not possible. Maybe it would be interesting
to find a way use this method instead of OrderedDict as that might be
less resource consuming.
This said, I don't think this part of poezio is a bottleneck at all, so
maybe this is just fine as is.
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
function.
|
|
|
|
|
|
|
|
timestamp
|
|
|
|
|
|
|
|
|
|
|
|
In the case python-gobject isn’t installed, but another package (such as
libibus) provides overrides, the gi module will still get imported fine
despite being empty, resulting in a traceback. To prevent this, we also
catch AttributeError so that gi.require_version can fail.
|
|
Tabnames should be treated as opaque strings.
This specific fix prevents tabname (JID) to be compared with invalid
stringly-typed JIDs. JID's __eq__ method used to (after
poezio/slixmpp@47968963) try and convert anything into JIDs. This has
been fixed and now properly returns NotImplemented.
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
`ChatTab.name` is now its own property. It only mirrors `ChatTab.jid`
when it is None for compat reasons.
If code tries to set `ChatTab.name` and it is a valid JID, `ChatTab.jid`
is set instead for compat reasons and `ChatTab.name` stays with its
previous value.
To have `ChatTab.name` mirror `ChatTab.jid` again, set it to None.
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
|
|
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
This reverts commits:
d693479d05f1ada999c0e29a9d9e2f021dd59e50
2d0cc092fcd154b2d14be0c5ac0ff338607824a0
89a61b84bdb29d3df8c08436c3484fddba8d2ef1
8194d9afbdec2daa1377e07ebb26bb99406473d0
e256c31875c8b67d85fe30d3e2c14c896066657a
a21335ac171a827a613dcce744898e822689c9d3
c96e528a8fd1313f75cb792a8e4826fbcfde1bec
0551867bfdb8dfa7dbd5964a15a1a950510e2c71
6ab49c188a6e5bb95773165f0bdbd672b41c8c81
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|
|
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
|