# HG changeset patch # User Matti Hamalainen # Date 1687431109 -10800 # Node ID e1aba44b8c7b183de94e8c2b60f18938aabbf315 # Parent 8a6cca58e853142964fae3e04ad7670b114ab2ff weather: Show limit of matches. diff -r 8a6cca58e853 -r e1aba44b8c7b config.weather.example --- 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 -- listaa mittausasemat joiden nimi matsaa patternin kanssa" } diff -r 8a6cca58e853 -r e1aba44b8c7b weather.tcl --- 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"]