* [PATCH] test: notmuch_drop_mail_headers() style update
@ 2017-09-03 20:24 Tomi Ollila
2017-09-04 11:13 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: Tomi Ollila @ 2017-09-03 20:24 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
Changed "" quotes to '' as we're not supposed to dynamically
alter python program (via shell $variable expansion).
Added space to python program to match general python style.
Replaced $* with 'idiomatic' "$@" to serve as better example.
---
It seems `email` headers is not dictionary; hdr.pop(x) does
not exist, and del hdr[x] on nonexistent header does not
raise KeyError. Fine.
We use both "${@}" and "$@". IMO "${@}" is ugly when unnecessary.
test/test-lib.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 09ee815d..35024649 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -509,12 +509,12 @@ NOTMUCH_DUMP_TAGS ()
notmuch_drop_mail_headers ()
{
- $NOTMUCH_PYTHON -c "
-import email,sys
-msg=email.message_from_file(sys.stdin)
+ $NOTMUCH_PYTHON -c '
+import email, sys
+msg = email.message_from_file(sys.stdin)
for hdr in sys.argv[1:]: del msg[hdr]
print(msg.as_string(False))
-" $*
+' "$@"
}
notmuch_search_sanitize ()
--
2.13.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] test: notmuch_drop_mail_headers() style update
2017-09-03 20:24 [PATCH] test: notmuch_drop_mail_headers() style update Tomi Ollila
@ 2017-09-04 11:13 ` David Bremner
0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2017-09-04 11:13 UTC (permalink / raw)
To: Tomi Ollila, notmuch; +Cc: tomi.ollila
Tomi Ollila <tomi.ollila@iki.fi> writes:
> Changed "" quotes to '' as we're not supposed to dynamically
> alter python program (via shell $variable expansion).
>
> Added space to python program to match general python style.
>
> Replaced $* with 'idiomatic' "$@" to serve as better example.
pushed
d
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-04 11:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-03 20:24 [PATCH] test: notmuch_drop_mail_headers() style update Tomi Ollila
2017-09-04 11:13 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).