Bug#681272: weather-util: please make -q quieter

2012-07-12 Thread Jeremy Stanley
Odd, my first message must have gotten greylisted by BDO since it's
showing up after my second message in the bug log. At any rate, I'm
attaching the patch I'll be applying in the next upstream release in
case you or anyone else using 2.0 finds it useful to apply manually
in the interim.
-- 
{ IRL(Jeremy_Stanley); WWW(http://fungi.yuggoth.org/); PGP(43495829);
WHOIS(STANL3-ARIN); SMTP(fu...@yuggoth.org); FINGER(fu...@yuggoth.org);
MUD(kin...@katarsis.mudpy.org:6669); IRC(fu...@irc.yuggoth.org#ccl); }
diff -BENbpru old/weather.py new/weather.py
--- old/weather.py	2012-06-26 15:19:44.0 +
+++ new/weather.py	2012-07-12 21:18:08.0 +
@@ -79,7 +79,8 @@ class Selections:
 cache_search=(
 self.get(cache) and self.get(cache_search)
 ),
-cachedir=self.get(cachedir)
+cachedir=self.get(cachedir),
+quiet=self.get_bool(quiet)
 )
 self.config.add_section(argument)
 for item in guessed.items():
@@ -699,7 +700,8 @@ def guess(
 info=False,
 cache_search=False,
 cacheage=900,
-cachedir=.
+cachedir=.,
+quiet=False
 ):
 Find URIs using airport, gecos, placename, station, ZCTA/ZIP, zone.
 import codecs, datetime, time, os, re, sys
@@ -732,7 +734,7 @@ def guess(
 (0.995, excellent),
 (1.000, ideal),
 ]
-print(Searching via %s...%searchtype)
+if not quiet: print(Searching via %s...%searchtype)
 stations = configparser.ConfigParser()
 dataname = stations
 if dataname in datafiles:
@@ -796,7 +798,8 @@ def guess(
 if stations.has_option(station[0], zone):
 zone = eval( stations.get(station[0], zone) )
 dataset = stations
-if not info and stations.has_option( station[0], description ):
+if not ( info or quiet ) \
+and stations.has_option( station[0], description ):
 print(
 [%s result %s] % (
 action,
@@ -819,7 +822,8 @@ def guess(
 if stations.has_option(expression, zone):
 zone = eval( stations.get(expression, zone) )
 dataset = stations
-if not info and stations.has_option(expression, description):
+if not ( info or quiet ) \
+and stations.has_option(expression, description):
 print(
 [%s result %s] % (
 action,
@@ -841,7 +845,8 @@ def guess(
 station = eval( zones.get(expression, station) )
 dataset = zones
 search = (expression, NWS/NOAA weather zone %s % expression)
-if not info and zones.has_option(expression, description):
+if not ( info or quiet ) \
+and zones.has_option(expression, description):
 print(
 [%s result %s] % (
 action,
@@ -939,7 +944,8 @@ def guess(
 )
 if places.has_option(place, zone):
 zone = eval( places.get(place, zone) )
-if not info and places.has_option(place, description):
+if not ( info or quiet ) \
+and places.has_option(place, description):
 print(
 [%s result %s] % (
 action,
@@ -992,7 +998,8 @@ def guess(
 description = zones.get(place, description)
 zone = (place, 0.0)
 search = ( expression, NWS/NOAA weather zone %s % place )
-if not info: print( [%s result %s] % (action, description) )
+if not ( info or quiet ):
+print( [%s result %s] % (action, description) )
 if not possibilities and not station[0]:
 message = No FIPS code/census area match in the %s file.\n % (
 datafiles[places][0]


Bug#681272: weather-util: please make -q quieter

2012-07-11 Thread Eric Cooper
Package: weather-util
Version: 2.0-1
Severity: normal

Even with -q, weather still prints the following lines on stdout:

Searching via station...
[caching result Greater Pittsburgh International, PA, United States]

Please don't print them when -q is specified; it makes it less convenient
to use the output.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (400, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages weather-util depends on:
ii  python  2.7.3~rc2-1

Versions of packages weather-util recommends:
ii  weather-util-data  2.0-1

weather-util suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#681272: weather-util: please make -q quieter

2012-07-11 Thread Jeremy Stanley
On 2012-07-11 21:17:59 + (+), Jeremy Stanley wrote:
[...]
 hopefully I can get the RMs to hint it in
[...]

Scratch that. Re-reading the Wheezy release policy, we'd need to be
able to argue that this is at least important: a bug which has a
major effect on the usability of a package, without rendering it
completely unusable to everyone.

I'll definitely make sure to attach a backported patch for this to
the bug report, however, and make a package for the new version
available on the upstream site. I'd rather refrain from uploading it
to unstable until the release, so that in the event we do turn up
important or higher bugs between now and then those fixes can go
into unstable and won't have to filter through TPU.
-- 
{ IRL(Jeremy_Stanley); WWW(http://fungi.yuggoth.org/); PGP(43495829);
WHOIS(STANL3-ARIN); SMTP(fu...@yuggoth.org); FINGER(fu...@yuggoth.org);
MUD(kin...@katarsis.mudpy.org:6669); IRC(fu...@irc.yuggoth.org#ccl); }



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#681272: weather-util: please make -q quieter

2012-07-11 Thread Jeremy Stanley
Thanks! I'll fix this upstream and backport a patch for the version
going into Wheezy (hopefully I can get the RMs to hint it in). I
agree the search cache notification doesn't belong in terse output.
-- 
{ IRL(Jeremy_Stanley); WWW(http://fungi.yuggoth.org/); PGP(43495829);
WHOIS(STANL3-ARIN); SMTP(fu...@yuggoth.org); FINGER(fu...@yuggoth.org);
MUD(kin...@katarsis.mudpy.org:6669); IRC(fu...@irc.yuggoth.org#ccl); }



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org