* [PR PATCH] todoman: add completions, edit dependencies
@ 2022-09-14 8:17 balejk
2022-09-15 10:12 ` [PR REVIEW] " classabbyamp
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: balejk @ 2022-09-14 8:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]
There is a new pull request by balejk against master on the void-packages repository
https://github.com/balejk/void-packages todoman_completions
https://github.com/void-linux/void-packages/pull/39278
todoman: add completions, edit dependencies
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/39278.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-todoman_completions-39278.patch --]
[-- Type: text/x-diff, Size: 5925 bytes --]
From de9df38963a202605c2ce62200230ac067ceefb3 Mon Sep 17 00:00:00 2001
From: Karel Balej <balejk@matfyz.cz>
Date: Sat, 27 Aug 2022 13:15:01 +0200
Subject: [PATCH] todoman: add completions, edit dependencies
---
srcpkgs/todoman/patches/zsh_completion.patch | 82 ++++++++++++++++++++
srcpkgs/todoman/template | 7 +-
2 files changed, 87 insertions(+), 2 deletions(-)
create mode 100644 srcpkgs/todoman/patches/zsh_completion.patch
diff --git a/srcpkgs/todoman/patches/zsh_completion.patch b/srcpkgs/todoman/patches/zsh_completion.patch
new file mode 100644
index 000000000000..c5c89dde1709
--- /dev/null
+++ b/srcpkgs/todoman/patches/zsh_completion.patch
@@ -0,0 +1,82 @@
+diff --git a/contrib/completion/zsh/_todo b/contrib/completion/zsh/_todo
+index b9bbe8a..53976e7 100644
+--- a/contrib/completion/zsh/_todo
++++ b/contrib/completion/zsh/_todo
+@@ -5,7 +5,7 @@ local common_options_help=(
+ '(- :)--help[Show a help message and exit]'
+ )
+ local common_options_start=(
+- {-s,--start=}'[When the task starts]:DATE:__todo_date'
++ '--start=[When the task starts]:DATE:__todo_date'
+ )
+ local common_options_due=(
+ {-d,--due=}'[When the task is due]:DATE:__todo_date'
+@@ -32,7 +32,7 @@ __color_mode(){
+ # }}}
+ # {{{ general helper: set variable of path to configuration file
+ __todo_set_conf(){
+- todoman_configuration_file=${XDG_CONFIG_DIR:-${HOME}/.config}/todoman/todoman.conf
++ todoman_configuration_file=${XDG_CONFIG_DIR:-${HOME}/.config}/todoman/config.py
+ if [[ -f $todoman_configuration_file ]]; then
+ return 0
+ else
+@@ -43,7 +43,7 @@ __todo_set_conf(){
+ # {{{ general helper: set variable main.path from configuration file
+ __todo_set_conf_path(){
+ if __todo_set_conf; then
+- tasks_lists_path="$(sed -n -e 's/^[^#]\s*path\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null)"
++ tasks_lists_path="$(sed -n -e "s/^\\s*path\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null)"
+ # the eval echo is needed since the path may contain ~ which should be evalueated to $HOME
+ tasks_lists_dir="$(eval echo ${tasks_lists_path%/\**})"
+ if [[ -z "${tasks_lists_path}" || ! -d "${tasks_lists_dir}" ]]; then
+@@ -59,18 +59,18 @@ __todo_set_conf_path(){
+ # {{{ general helper: set variables related to date and time formats for __todo_date
+ __todo_set_conf_dt(){
+ if __todo_set_conf; then
+- date_format="$(eval echo $(sed -n -e 's/^[^#]\s*date_format\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null))"
+- dt_separator="$(eval echo $(sed -n -e 's/^[^#]\s*dt_separator\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null))"
+- time_format="$(eval echo $(sed -n -e 's/^[^#]\s*time_format\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null))"
++ date_format="$(eval echo $(sed -n -e "s/^\\s*date_format\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null))"
++ dt_separator="$(eval echo $(sed -n -e "s/^\\s*dt_separator\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null))"
++ time_format="$(eval echo $(sed -n -e "s/^\\s*time_format\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null))"
+ # default value according to documentation: https://todoman.readthedocs.io/en/stable/configure.html
+ if [[ -z "${date_format}" ]]; then
+ date_format="%x"
+ fi
+ if [[ -z "${dt_separator}" ]]; then
+- dt_separator=""
++ dt_separator=" "
+ fi
+ if [[ -z "${time_format}" ]]; then
+- time_format="%x"
++ time_format="%X"
+ fi
+ return 0
+ else
+@@ -150,7 +150,7 @@ __todo_lists(){
+ zstyle ":completion:${curcontext}:" cache-policy __todo_lists_cache_policy
+ fi
+ local -a tasks_lists
+- if _cache_invalid todoman_lists; then
++ if _cache_invalid todoman_lists || ! _retrieve_cache todoman_lists; then
+ if [[ ${tasks_lists_path} =~ '/*$' ]]; then
+ for dir in $(eval echo ${tasks_lists_path}); do
+ if grep "VTODO" -q -R "${dir}"; then
+@@ -160,8 +160,6 @@ __todo_lists(){
+ done
+ fi
+ _store_cache todoman_lists tasks_lists
+- else
+- _retrieve_cache todoman_lists
+ fi
+ if [[ "${#tasks_lists[@]}" == 1 ]]; then
+ _message "only one list was detected: (\"${tasks_lists[1]}\")"
+@@ -243,7 +241,7 @@ _command_list_options=(
+ '(--reverse --no-reverse)'{--reverse,--no-reverse}'[sort tasks in reverse order (see --sort)]'
+ "${common_options_start[@]}"
+ "${common_options_due[@]}"
+- '--priority[Only show tasks with priority at least as high as TEXT]:TEXT:("low", "medium", "high")'
++ '--priority=[Only show tasks with priority at least as high as TEXT]:TEXT:("low" "medium" "high")'
+ '--startable[Show only todos which should can be started today]'
+ {-s,--status=}'[Show only todos with the provided comma-separated statuses]:STATUS:{_values -s , "status" "NEEDS-ACTION" "CANCELLED" "COMPLETED" "IN-PROCESS" "ANY"}'
+ "${common_options_help[@]}"
diff --git a/srcpkgs/todoman/template b/srcpkgs/todoman/template
index 75584e7710c6..f954a2f83467 100644
--- a/srcpkgs/todoman/template
+++ b/srcpkgs/todoman/template
@@ -1,12 +1,12 @@
# Template file for 'todoman'
pkgname=todoman
version=4.1.0
-revision=1
+revision=2
build_style=python3-module
hostmakedepends="python3-setuptools_scm"
depends="python3-icalendar python3-urwid python3-xdg python3-parsedatetime
python3-atomicwrites python3-click-repl python3-click-log
- python3-dateutil python3-tabulate python3-humanize"
+ python3-dateutil python3-humanize jq"
checkdepends="${depends} python3-freezegun python3-hypothesis
python3-pytest-cov python3-pytest-xdist"
short_desc="Simple, standards-based, cli todo (aka: task) manager"
@@ -19,4 +19,7 @@ checksum=ce3caa481d923e91da9b492b46509810a754e2d3ef857f5d20bc5a8e362b50c8
post_install() {
vlicense LICENCE
+ vcompletion contrib/completion/zsh/_todo zsh todo
+ vcompletion contrib/completion/bash/_todo bash todo
+ vsconf config.py.sample
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR REVIEW] todoman: add completions, edit dependencies
2022-09-14 8:17 [PR PATCH] todoman: add completions, edit dependencies balejk
@ 2022-09-15 10:12 ` classabbyamp
2022-09-15 10:45 ` [PR PATCH] [Updated] " balejk
2022-09-15 12:25 ` [PR PATCH] [Merged]: " classabbyamp
2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2022-09-15 10:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 215 bytes --]
New review comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/39278#discussion_r971799706
Comment:
can you add a note at the top that this was also sent upstream?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Updated] todoman: add completions, edit dependencies
2022-09-14 8:17 [PR PATCH] todoman: add completions, edit dependencies balejk
2022-09-15 10:12 ` [PR REVIEW] " classabbyamp
@ 2022-09-15 10:45 ` balejk
2022-09-15 12:25 ` [PR PATCH] [Merged]: " classabbyamp
2 siblings, 0 replies; 4+ messages in thread
From: balejk @ 2022-09-15 10:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]
There is an updated pull request by balejk against master on the void-packages repository
https://github.com/balejk/void-packages todoman_completions
https://github.com/void-linux/void-packages/pull/39278
todoman: add completions, edit dependencies
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/39278.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-todoman_completions-39278.patch --]
[-- Type: text/x-diff, Size: 6050 bytes --]
From c30934c95e4d39753c1c034a5af198a8e3f27154 Mon Sep 17 00:00:00 2001
From: Karel Balej <balejk@matfyz.cz>
Date: Sat, 27 Aug 2022 13:15:01 +0200
Subject: [PATCH] todoman: add completions, edit dependencies
---
srcpkgs/todoman/patches/zsh_completion.patch | 86 ++++++++++++++++++++
srcpkgs/todoman/template | 7 +-
2 files changed, 91 insertions(+), 2 deletions(-)
create mode 100644 srcpkgs/todoman/patches/zsh_completion.patch
diff --git a/srcpkgs/todoman/patches/zsh_completion.patch b/srcpkgs/todoman/patches/zsh_completion.patch
new file mode 100644
index 000000000000..6b29b03be789
--- /dev/null
+++ b/srcpkgs/todoman/patches/zsh_completion.patch
@@ -0,0 +1,86 @@
+A pull request containing this patch has been submitted upstream [1].
+
+[1] https://github.com/pimutils/todoman/pull/495
+
+diff --git a/contrib/completion/zsh/_todo b/contrib/completion/zsh/_todo
+index b9bbe8a..53976e7 100644
+--- a/contrib/completion/zsh/_todo
++++ b/contrib/completion/zsh/_todo
+@@ -5,7 +5,7 @@ local common_options_help=(
+ '(- :)--help[Show a help message and exit]'
+ )
+ local common_options_start=(
+- {-s,--start=}'[When the task starts]:DATE:__todo_date'
++ '--start=[When the task starts]:DATE:__todo_date'
+ )
+ local common_options_due=(
+ {-d,--due=}'[When the task is due]:DATE:__todo_date'
+@@ -32,7 +32,7 @@ __color_mode(){
+ # }}}
+ # {{{ general helper: set variable of path to configuration file
+ __todo_set_conf(){
+- todoman_configuration_file=${XDG_CONFIG_DIR:-${HOME}/.config}/todoman/todoman.conf
++ todoman_configuration_file=${XDG_CONFIG_DIR:-${HOME}/.config}/todoman/config.py
+ if [[ -f $todoman_configuration_file ]]; then
+ return 0
+ else
+@@ -43,7 +43,7 @@ __todo_set_conf(){
+ # {{{ general helper: set variable main.path from configuration file
+ __todo_set_conf_path(){
+ if __todo_set_conf; then
+- tasks_lists_path="$(sed -n -e 's/^[^#]\s*path\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null)"
++ tasks_lists_path="$(sed -n -e "s/^\\s*path\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null)"
+ # the eval echo is needed since the path may contain ~ which should be evalueated to $HOME
+ tasks_lists_dir="$(eval echo ${tasks_lists_path%/\**})"
+ if [[ -z "${tasks_lists_path}" || ! -d "${tasks_lists_dir}" ]]; then
+@@ -59,18 +59,18 @@ __todo_set_conf_path(){
+ # {{{ general helper: set variables related to date and time formats for __todo_date
+ __todo_set_conf_dt(){
+ if __todo_set_conf; then
+- date_format="$(eval echo $(sed -n -e 's/^[^#]\s*date_format\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null))"
+- dt_separator="$(eval echo $(sed -n -e 's/^[^#]\s*dt_separator\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null))"
+- time_format="$(eval echo $(sed -n -e 's/^[^#]\s*time_format\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null))"
++ date_format="$(eval echo $(sed -n -e "s/^\\s*date_format\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null))"
++ dt_separator="$(eval echo $(sed -n -e "s/^\\s*dt_separator\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null))"
++ time_format="$(eval echo $(sed -n -e "s/^\\s*time_format\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null))"
+ # default value according to documentation: https://todoman.readthedocs.io/en/stable/configure.html
+ if [[ -z "${date_format}" ]]; then
+ date_format="%x"
+ fi
+ if [[ -z "${dt_separator}" ]]; then
+- dt_separator=""
++ dt_separator=" "
+ fi
+ if [[ -z "${time_format}" ]]; then
+- time_format="%x"
++ time_format="%X"
+ fi
+ return 0
+ else
+@@ -150,7 +150,7 @@ __todo_lists(){
+ zstyle ":completion:${curcontext}:" cache-policy __todo_lists_cache_policy
+ fi
+ local -a tasks_lists
+- if _cache_invalid todoman_lists; then
++ if _cache_invalid todoman_lists || ! _retrieve_cache todoman_lists; then
+ if [[ ${tasks_lists_path} =~ '/*$' ]]; then
+ for dir in $(eval echo ${tasks_lists_path}); do
+ if grep "VTODO" -q -R "${dir}"; then
+@@ -160,8 +160,6 @@ __todo_lists(){
+ done
+ fi
+ _store_cache todoman_lists tasks_lists
+- else
+- _retrieve_cache todoman_lists
+ fi
+ if [[ "${#tasks_lists[@]}" == 1 ]]; then
+ _message "only one list was detected: (\"${tasks_lists[1]}\")"
+@@ -243,7 +241,7 @@ _command_list_options=(
+ '(--reverse --no-reverse)'{--reverse,--no-reverse}'[sort tasks in reverse order (see --sort)]'
+ "${common_options_start[@]}"
+ "${common_options_due[@]}"
+- '--priority[Only show tasks with priority at least as high as TEXT]:TEXT:("low", "medium", "high")'
++ '--priority=[Only show tasks with priority at least as high as TEXT]:TEXT:("low" "medium" "high")'
+ '--startable[Show only todos which should can be started today]'
+ {-s,--status=}'[Show only todos with the provided comma-separated statuses]:STATUS:{_values -s , "status" "NEEDS-ACTION" "CANCELLED" "COMPLETED" "IN-PROCESS" "ANY"}'
+ "${common_options_help[@]}"
diff --git a/srcpkgs/todoman/template b/srcpkgs/todoman/template
index 75584e7710c6..f954a2f83467 100644
--- a/srcpkgs/todoman/template
+++ b/srcpkgs/todoman/template
@@ -1,12 +1,12 @@
# Template file for 'todoman'
pkgname=todoman
version=4.1.0
-revision=1
+revision=2
build_style=python3-module
hostmakedepends="python3-setuptools_scm"
depends="python3-icalendar python3-urwid python3-xdg python3-parsedatetime
python3-atomicwrites python3-click-repl python3-click-log
- python3-dateutil python3-tabulate python3-humanize"
+ python3-dateutil python3-humanize jq"
checkdepends="${depends} python3-freezegun python3-hypothesis
python3-pytest-cov python3-pytest-xdist"
short_desc="Simple, standards-based, cli todo (aka: task) manager"
@@ -19,4 +19,7 @@ checksum=ce3caa481d923e91da9b492b46509810a754e2d3ef857f5d20bc5a8e362b50c8
post_install() {
vlicense LICENCE
+ vcompletion contrib/completion/zsh/_todo zsh todo
+ vcompletion contrib/completion/bash/_todo bash todo
+ vsconf config.py.sample
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Merged]: todoman: add completions, edit dependencies
2022-09-14 8:17 [PR PATCH] todoman: add completions, edit dependencies balejk
2022-09-15 10:12 ` [PR REVIEW] " classabbyamp
2022-09-15 10:45 ` [PR PATCH] [Updated] " balejk
@ 2022-09-15 12:25 ` classabbyamp
2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2022-09-15 12:25 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]
There's a merged pull request on the void-packages repository
todoman: add completions, edit dependencies
https://github.com/void-linux/void-packages/pull/39278
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-15 12:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 8:17 [PR PATCH] todoman: add completions, edit dependencies balejk
2022-09-15 10:12 ` [PR REVIEW] " classabbyamp
2022-09-15 10:45 ` [PR PATCH] [Updated] " balejk
2022-09-15 12:25 ` [PR PATCH] [Merged]: " classabbyamp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).