~ihabunek

Zagreb, Croatia

~ihabunek/toot-discuss

Last active 26 days ago

~ihabunek/triglav-discuss

Last active 1 year, 4 months ago
View more

Recent activity

Re: Password manager 26 days ago

From Ivan Habunek to ~ihabunek/toot-discuss

On Sat, 30 Apr 2022, at 15:32, Dimitris Kardarakos wrote:
> At the moment, the access token is saved into the config.json file. I 
> suppose there is no way to read the token from a password manager, e.g. 
> using a terminal command or any plan to integrate with the freedesktop 
> secrets API?

Hi Dimitris,

You're right. Toot does not integrate with password managers / secrets API currently. I'm not convinced this something that belongs in toot since there are so many options for storing secrets we can't possibly support them all.

Regards,
Ivan

Re: Mutable default function argument 5 months ago

From Ivan Habunek to ~ihabunek/toot-discuss

On Fri, 10 Dec 2021, at 06:47, Abhiseck Paira wrote:
> While reading the file toot/http.py, I noticed that the function `post'
> specifies a dictionary as the default value of the `headers' parameter.
>
>   def post(app, user, url, data=None, files=None, allow_redirects=True, 
> headers={})
>
> Since Python Tutorial section 4.7.1 recommends against using mutable
> objects as default value 'cause default value gets mutated every time
> the function gets called, I was wondering if this `post' definition
> mentioned above is intentional or by mistake.

Hi Abhiseck,

[PATCH sr.ht-docs v3] todo.sr.ht: Document sorting 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

---
 todo.sr.ht/index.md | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/todo.sr.ht/index.md b/todo.sr.ht/index.md
index 2ba29c7..e781488 100644
--- a/todo.sr.ht/index.md
+++ b/todo.sr.ht/index.md
@@ -32,14 +32,37 @@ include:
- `status:open` or `status:closed`
- `label`: an optional label that is assigned to a ticket for organizational
  purposes
- `order`: the order in which tickets are displayed. By default this is by
  time of last update
[message trimmed]

[PATCH todo.sr.ht v4 2/3] Store ticket comment counts in the database 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

This saves a query when rendering the tracker page, and allows sorting
by comment count which can be given as a sorting option.
---
 .../6099fe670392_add_ticket_comment_count.py  | 32 +++++++++++++++++++
 todosrht/blueprints/tracker.py                |  8 ++---
 todosrht/templates/tracker.html               |  7 ++--
 todosrht/tickets.py                           | 15 +++++----
 todosrht/types/ticket.py                      |  1 +
 5 files changed, 46 insertions(+), 17 deletions(-)
 create mode 100644 todosrht/alembic/versions/6099fe670392_add_ticket_comment_count.py

diff --git a/todosrht/alembic/versions/6099fe670392_add_ticket_comment_count.py b/todosrht/alembic/versions/6099fe670392_add_ticket_comment_count.py
new file mode 100644
index 0000000..4bbd20b
[message trimmed]

[PATCH todo.sr.ht v4 3/3] Allow sorting by number of comments 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

---
 todosrht/search.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/todosrht/search.py b/todosrht/search.py
index d1aa98f..1ca28a0 100644
--- a/todosrht/search.py
+++ b/todosrht/search.py
@@ -107,6 +107,7 @@ def apply_search(query, search_string, current_user):
    return apply_sort(query, sort_terms, {
        "created": Ticket.created,
        "updated": Ticket.updated,
        "comments": Ticket.comment_count,
    })
[message trimmed]

[PATCH todo.sr.ht v4 1/3] Implement sorting in ticket search 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

By default tickets are sorted by updated DESC, if not otherwise defined.

Sort order is defined by entering `sort:<term>` in the search box where
`<term>` can be one of `updated` or `created`. More terms can be added
later.

Sort order is descending by default, it can be reversed by specifying
`rsort:<term>` instead.
---
 tests/test_search.py            | 112 ++++++++++++++++++++++----------
 todosrht/blueprints/tracker.py  |   3 +-
 todosrht/search.py              |  38 ++++++++++-
 todosrht/templates/tracker.html |   2 +-
 4 files changed, 113 insertions(+), 42 deletions(-)
[message trimmed]

[sr.ht-docs v2] todo.sr.ht: Document sorting 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

---
v2 changes how reverse sort is applied - `rsort:term` replaces
`sort:-term`.

 todo.sr.ht/index.md | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/todo.sr.ht/index.md b/todo.sr.ht/index.md
index 2ba29c7..e781488 100644
--- a/todo.sr.ht/index.md
+++ b/todo.sr.ht/index.md
@@ -32,14 +32,37 @@ include:
- `status:open` or `status:closed`
- `label`: an optional label that is assigned to a ticket for organizational
[message trimmed]

[todo.sr.ht v3 3/3] Allow sorting by number of comments 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

---
 todosrht/search.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/todosrht/search.py b/todosrht/search.py
index d1aa98f..1ca28a0 100644
--- a/todosrht/search.py
+++ b/todosrht/search.py
@@ -107,6 +107,7 @@ def apply_search(query, search_string, current_user):
    return apply_sort(query, sort_terms, {
        "created": Ticket.created,
        "updated": Ticket.updated,
        "comments": Ticket.comment_count,
    })
[message trimmed]

[todo.sr.ht v3 2/3] Store ticket comment counts in the database 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

This saves a query when rendering the tracker page, and allows sorting
by comment count which can be given as a sorting option.
---
 .../6099fe670392_add_ticket_comment_count.py  | 32 +++++++++++++++++++
 todosrht/blueprints/tracker.py                |  8 ++---
 todosrht/templates/tracker.html               |  7 ++--
 todosrht/tickets.py                           | 15 +++++----
 todosrht/types/ticket.py                      |  1 +
 5 files changed, 46 insertions(+), 17 deletions(-)
 create mode 100644 todosrht/alembic/versions/6099fe670392_add_ticket_comment_count.py

diff --git a/todosrht/alembic/versions/6099fe670392_add_ticket_comment_count.py b/todosrht/alembic/versions/6099fe670392_add_ticket_comment_count.py
new file mode 100644
index 0000000..4bbd20b
[message trimmed]

[todo.sr.ht v3 1/3] Implement sorting in ticket search 8 months ago

From Ivan Habunek to ~sircmpwn/sr.ht-dev

By default tickets are sorted by updated DESC, if not otherwise defined.

Sort order is defined by entering `sort:<term>` in the search box where
`<term>` can be one of `updated` or `created`. More terms can be added
later.

Sort order is descending by default, it can be reversed by specifying
`rsort:<term>` instead.
---
 tests/test_search.py            | 112 ++++++++++++++++++++++----------
 todosrht/blueprints/tracker.py  |   3 +-
 todosrht/search.py              |  38 ++++++++++-
 todosrht/templates/tracker.html |   2 +-
 4 files changed, 113 insertions(+), 42 deletions(-)
[message trimmed]