Imap re-connection is not working.
Connection exceptions (socket.error, socket.gaierror, IMAP4.abort) can
be raise during any imap operations, not only on connection
establishment.
Also the idle thread call start() on thread multiple times, but this is
not allowed by python. The thread is not daemonize, so the thread code
can be never runned if the python process is busy. And the module is
located in imaplib2.imaplib2.IMAP4 not imaplib2.IMAP4...
This change fixes all of that.
Weather.com's XML feed is now defunct, this commit includes a rewritten
Weather.com module which uses the same JSON feed used by the website
itself.
The weather updates now happen in a separate thread rather than
happening in the ``run()`` function. Since the ``run()`` function is
executed before any of the mouse events are run, this was causing the
mouse event callbacks to result in a flurry of weather updates, which
caused the Weather Underground API to be overutilized beyond its rate
limit.
When a desktop notification is displayed but there is no notification
daemon running, an exception is raised.
This fixes the traceback by adding a logger to the DesktopNotification
class, and logging an error when the exception is caught.
Fixes#453.
When the pytz dep was reintroduced, this made all TZ usage reliant upon
a tzinfo object generated by pytz. This had the effect of making the
``%Z`` strftime placeholder evaluate as blank when a timezone is not
explicitly defined (i.e. when the format is just a format string and
not a tuple containing the format string and timezone).
This commit resolves this regression by using pytz to build a tzinfo
object from either /etc/localtime or /etc/timezone during the ``init()``
function, establishing the system TZ to be used for those cases where no
TZ was specified.
Somehow I accidentially had 2 win_percent values being set in the cdict,
one of which was a string that breaks when you try to round off the
remainder.
The openstack novaclient has updated it's auth mechanism, deprecating
the method used in this module. This patch updates the novaclient
authentication call to leverage this new auth method.
subprocess.Popen() does not implicitly wait() on the child process.
This leads to transient zombie pactl processes which are only reaped
as new processes are spawned.
Use synchronous subprocess communication to collect child process
return codes immediately and allow them to exit.
Tonight's game was the first time I've seen the API return from a
suspended game. I added a separate format option for it.
I've also fixed date/time detection. The API returns different fields for if
a game ended after midnight eastern, and also different ones when a game
is suspended.
Volume changes may occur externally (e.g. through pactl bound to media
keys) or through mouse interaction. The new volume is received
asynchronously but can only be outputted at the next status poll,
causing a small delay.
Introduce Module.send_output() to allow a module to send its output
without delay. Invoke this method in the Pulseaudio sink info callback.
I had added this to be able to use a different icon for thunderstorms,
which were at the time not even being detected as a weather condition
and were just falling back to the default (i.e. no colorization nor
icon). However, the only thunder/lightning unicode icon that is widely
available is too tall, leading to the entire module's text being
vertically-aligned on a different plane from the rest of the modules in
the status bar.
This commit changes the default icon to the same one used for "Rainy"
conditions, while preserving it as a distinct weather type so that
others can still use their own icon if they so choose.
During the offseason, the context URL which provides params used to
locate information on a given game redirects to the EPL mainpage.
This commit properly catches these cases, and also adds some helpful
logging to the ScoresBackend api_request() function.
Notification summary shows the count
Notification icon is `software-update-available`
notif_body concatenates raw or prepared output from all backends
Backends that don't yet output to notif_body should have harmless empty string
Also, linted according to flake8
Corrected typo
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.
On timer start timezone is provided to `datetime.now()` call, but on refresh is not.
That cause a bug with wrong time difference (it include timezone diff). Didn't
dig deep enough to figure out why there is inconsistency with timezones so just
pin timezone info as it's not useful anyway.
This module will display the current open file handles and the kernel
setting for max open file handles. This is particularly useful when
running applications that like to grab a lot of file handles to help
monitor if/when your system may run out of available file handles.
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.