Commit Graph

13 Commits

Author SHA1 Message Date
mataha
9d23087ca4 Introduce 'dumb' mode for terminals without fallback glyphs
Windows' native terminal, `conhost.exe`, lacks font fallback support.
This causes some of the characters used in `wttr.in`'s terminal output
to not be displayed at all - placeholders are supplied in their place.
This PR provides a mode that, when enabled, translates missing glyphs
to ones available on every platform without (*I believe*) making any
compromises regarding their meaning; see translation table below.

| Character        | C-UCP  | Replacements                          | R-UCPs |
| :--------------- | :----: | :------------------------------------ | :----: |
| NORTH WEST ARROW | U+2196 | BOX DRAWINGS LIGHT ARC DOWN AND LEFT  | U+256E |
| NORTH EAST ARROW | U+2197 | BOX DRAWINGS LIGHT ARC DOWN AND RIGHT | U+256D |
| SOUTH EAST ARROW | U+2198 | BOX DRAWINGS LIGHT ARC UP AND RIGHT   | U+2570 |
| SOUTH WEST ARROW | U+2199 | BOX DRAWINGS LIGHT ARC UP AND LEFT    | U+256F |
| HIGH VOLTAGE SIGN | U+26A1 | BOX DRAWINGS LIGHT DOWN AND RIGHT + UP AND LEFT | U+250C + U+2518 |
2023-08-09 19:02:39 +02:00
Jason Dusek
c7cb67f841
Ensure M enables metric
It seems reasonable, per the documentation (under the section, "Weather Units"), that `?M` would enable metric ("metric (SI), but show wind speed in m/s") all by itself.

> By default the USCS units are used for the queries from the USA and the metric system for the rest of the world. You can override this behavior...
> ...
> `curl wttr.in/Amsterdam?M`  # metric (SI), but show wind speed in m/s

In the USA, we have to pass `?m&M` (`https://wttr.in/?m&M`) to get metric and meters/second. If we just pass `?M`, we get USCS units for everything else and windspeed in meters/second.
2022-05-15 11:30:56 -05:00
Igor Chubin
0d5f6c298c v2+png: new experimental query encoding 2020-04-29 21:35:23 +02:00
Igor Chubin
e041280f27 do not pass query to view functions 2020-04-27 20:00:26 +02:00
Igor Chubin
0a8ab5e89f one-letter options in png files (#436) 2020-04-27 19:19:41 +02:00
Igor Chubin
71b3a70e02 view=format 2020-04-25 22:28:28 +02:00
Igor Chubin
7a8327c13f moved parse_wttrin_png_name() to lib/parse_query.py 2020-04-24 21:58:47 +02:00
Igor Chubin
5a4c57ce96 added new option: -A (force-ansi=True) (fixes #153) 2019-02-01 12:29:27 +01:00
Igor Chubin
6dfd809694 new option: F (no follow line) (fixes #214) 2019-01-11 12:48:00 +01:00
Igor Chubin
601bab5b19 moved metric_or_imperial to parse_query 2018-10-07 12:12:47 +02:00
Igor Chubin
2f5e67cccf added option ?M: use_ms_for_wind 2017-03-24 23:59:49 +01:00
Igor Chubin
d6f54216ad new option: T (no-terminal) 2017-03-22 16:16:21 +01:00
Igor Chubin
0ac8c3b86e parse_query.py: added lib/parse_query.py 2017-03-12 17:42:22 +01:00