Mercurial > hg > egg-tcls
changeset 691:e1aba44b8c7b
weather: Show limit of matches.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 22 Jun 2023 13:51:49 +0300 |
parents | 8a6cca58e853 |
children | c262cef9dc54 |
files | config.weather.example weather.tcl |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/config.weather.example Thu Jun 22 13:32:07 2023 +0300 +++ b/config.weather.example Thu Jun 22 13:51:49 2023 +0300 @@ -172,6 +172,7 @@ "no_access" "Ei oikeuksia muuttaa asetuksia." "stations_list" "Mittausasemat: @1@" + "stations_limit" " Yli @1@ osumaa, kaikkia ei listata." "stations_no_matches" "Ei osumia." "help_stations" "@cmd@ asemat <patterni> -- listaa mittausasemat joiden nimi matsaa patternin kanssa" }
--- a/weather.tcl Thu Jun 22 13:32:07 2023 +0300 +++ b/weather.tcl Thu Jun 22 13:51:49 2023 +0300 @@ -327,9 +327,10 @@ } if {[llength $result] > 0} { - set res [join [lrange $result 0 10] " ; "] - if {[llength $result] > 10} { - append res [weather_qm "stations_limit"] + set max_matches 10 + set res [join [lrange $result 0 $max_matches] " ; "] + if {[llength $result] > $max_matches} { + append res [weather_qm "stations_limit" $max_matches] } } else { set res [weather_qm "stations_no_matches"]