Nothing in imap mail backend reinit the imap connection
when this one is lost, and then the backend always output "socket.error:..."
This change fixes that by cleanup the connection object when
connection is lost so get_connection() will recreate a new one.
This also remove the unless utils.internet() checks already done by
Mail().run()
The win/loss values from the NHL data feed reset in the playoffs, but
don't reflect the current series. Instead, they reflect the current
win/loss total since the beginning of the playoffs.
This commit checks for a key in the API return data indicating that the
game is a playoff game, and if the game is a playoff game the team's
wins will be set to the remainder of the total wins divided by 4 (a team
with 6 overall wins will be assumed to have 2 wins in the current
playoff series).
The team's losses during a playoff series will be set to the amount of
wins for the opposing team.
This properly colorizes when there is a thunderstorm and the weather.com
API response defines the current weather condition as "T-Storm". No idea
why they decide to do this, it's definitely not for brevity as they have
a "Thunderstorms in the Vicinity" weather condition as well. Just a
weird quirk of their API, I guess.
* Fix improper usage of time.tzset()
time.tzname is a tuple containing the non-daylight-savings and
daylight-savings timezone abbreviations. However, when the TZ
environment variable is set to just the daylight-savings timezone (as
the clock module was changed to do in e31c58f), time.tzset() will break
time.tzname by setting both elements of the tuple to that timezone,
causing the effective timezone to fallback to UTC:
>>> time.tzname
('CST', 'CDT')
>>> time.localtime().tm_hour
1
>>> os.environ.putenv('TZ', 'CST')
>>> time.tzset()
>>> time.tzname
('CST', 'CST')
>>> # ^^^ This is broken
...
>>> time.localtime().tm_hour
6
>>> os.environ.putenv('TZ', 'CST+06:00CDT')
>>> time.tzset()
>>> time.tzname
('CST', 'CDT')
>>> time.localtime().tm_hour
1
This fixes this incorrect behavior by building a proper TZ environment
variable to set localtime.
* Use time.timezone instead of time.altzone
* Make _get_local_tz a static method
* mod bitcoin: add 'volume_percent'
* mod bitcoin: Fix exception on url opening (#304)
Calling user_open as a 'Python callback' raises an exception because
this function doesn't expects 'self'.
Wrote a wrapper function as a 'Member callback' to filter it out.
* mod bitcoin: add specific exchange support
* mod bitcoin: add request age attribute
* mod bitcoin: refactor
* mod bitcoin: btc volume divisor
* bitcoin: Deal with diffrent locales
* Fixing PEP8
* mod bitcoin: Updated docs
* Catch "Showers" as "Rainy" weather condition
Weather.com has a "Showers in the Vicinity" weather condition that I
just happened to see this morning. This commit assigns this condition as
"Rainy" so it is properly colorized.
* Make "Clear / Windy" map to "Fair" weather condition
Another odd weather condition from the weather.com API
* Reverse icons for Fair and Sunny
"Sunny" should have a filled-in sun icon as it implies a brighter weather
condition than "Fair" does.
* Properly detect "Sunny / Windy" as "Sunny" weather condition
Also, do not check for similarly-named conditions if an exact match is
found.
* Properly detect "Fair / Windy" as "Fair"