Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package bumblebee-status for
openSUSE:Factory checked in at 2021-04-12 12:36:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bumblebee-status (Old)
and /work/SRC/openSUSE:Factory/.bumblebee-status.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bumblebee-status"
Mon Apr 12 12:36:54 2021 rev:13 rq:884158 version:2.1.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/bumblebee-status/bumblebee-status.changes
2021-02-26 21:59:25.643819553 +0100
+++
/work/SRC/openSUSE:Factory/.bumblebee-status.new.2401/bumblebee-status.changes
2021-04-12 12:39:47.337538373 +0200
@@ -1,0 +2,12 @@
+Wed Apr 7 23:48:01 UTC 2021 - John Vandenberg <[email protected]>
+
+- Update to v2.1.4
+ * shell: do not default to "makewide"
+ * shell: remove obsolete event handlers
+- from v2.1.3
+ * Enable scrolling of shell module output
+ * Add fallback for user module loading
+ * Add a module "keys" that shows whether a key is pressed
+ * Make bumblebee more reactive
+
+-------------------------------------------------------------------
Old:
----
bumblebee-status-2.1.2.tar.gz
New:
----
bumblebee-status-2.1.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ bumblebee-status.spec ++++++
--- /var/tmp/diff_new_pack.49dn4t/_old 2021-04-12 12:39:47.857538978 +0200
+++ /var/tmp/diff_new_pack.49dn4t/_new 2021-04-12 12:39:47.861538982 +0200
@@ -18,7 +18,7 @@
%define skip_python2 1
Name: bumblebee-status
-Version: 2.1.2
+Version: 2.1.4
Release: 0
Summary: Modular, theme-able status line generator for the i3 window
manager
License: MIT
@@ -725,6 +725,7 @@
%{_datadir}/%{name}/bumblebee/modules/core/debug.py
%{_datadir}/%{name}/bumblebee/modules/core/disk.py
%{_datadir}/%{name}/bumblebee/modules/core/error.py
+%{_datadir}/%{name}/bumblebee/modules/core/keys.py
%{_datadir}/%{name}/bumblebee/modules/core/load.py
%{_datadir}/%{name}/bumblebee/modules/core/memory.py
%{_datadir}/%{name}/bumblebee/modules/core/nic.py
++++++ bumblebee-status-2.1.2.tar.gz -> bumblebee-status-2.1.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bumblebee-status-2.1.2/README.md
new/bumblebee-status-2.1.4/README.md
--- old/bumblebee-status-2.1.2/README.md 2021-02-20 14:49:45.000000000
+0100
+++ new/bumblebee-status-2.1.4/README.md 2021-03-18 15:30:03.000000000
+0100
@@ -1,6 +1,6 @@
# bumblebee-status
-[](https://travis-ci.org/tobi-wan-kenobi/bumblebee-status)
+[](https://travis-ci.com/tobi-wan-kenobi/bumblebee-status)
[](https://bumblebee-status.readthedocs.io/en/main/?badge=main)


diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bumblebee-status-2.1.2/bumblebee-status
new/bumblebee-status-2.1.4/bumblebee-status
--- old/bumblebee-status-2.1.2/bumblebee-status 2021-02-20 14:49:45.000000000
+0100
+++ new/bumblebee-status-2.1.4/bumblebee-status 2021-03-18 15:30:03.000000000
+0100
@@ -6,7 +6,6 @@
import time
import signal
import socket
-import select
import logging
import threading
@@ -39,45 +38,40 @@
self.__socket.close()
os.unlink(self.__name)
+def process_event(event_line, config, update_lock):
+ modules = {}
+ try:
+ event = json.loads(event_line)
+ core.input.trigger(event)
+ if "name" in event:
+ modules[event["name"]] = True
+ except ValueError:
+ pass
+
+ delay = float(config.get("engine.input_delay", 0.0))
+ if delay > 0:
+ time.sleep(delay)
+ if update_lock.acquire(blocking=False) == True:
+ core.event.trigger("update", modules.keys(), force=True)
+ core.event.trigger("draw")
+ update_lock.release()
-def handle_input(output, config, update_lock):
+def handle_commands(config, update_lock):
with CommandSocket() as cmdsocket:
- poll = select.poll()
- poll.register(sys.stdin.fileno(), select.POLLIN)
- poll.register(cmdsocket, select.POLLIN)
-
while True:
- events = poll.poll()
+ tmp, _ = cmdsocket.accept()
+ line = tmp.recv(4096).decode()
+ tmp.close()
+ logging.debug("socket event {}".format(line))
+ process_event(line, config, update_lock)
- modules = {}
- for fileno, event in events:
- if fileno == cmdsocket.fileno():
- tmp, _ = cmdsocket.accept()
- line = tmp.recv(4096).decode()
- tmp.close()
- logging.debug("socket event {}".format(line))
- else:
- line = "["
- while line.startswith("["):
- line = sys.stdin.readline().strip(",").strip()
- logging.info("input event: {}".format(line))
- try:
- event = json.loads(line)
- core.input.trigger(event)
- if "name" in event:
- modules[event["name"]] = True
- except ValueError:
- pass
-
- delay = float(config.get("engine.input_delay", 0.2))
- if delay > 0:
- time.sleep(delay)
- if update_lock.acquire(blocking=False) == True:
- core.event.trigger("update", modules.keys(), force=True)
- core.event.trigger("draw")
- update_lock.release()
- poll.unregister(sys.stdin.fileno())
+def handle_events(config, update_lock):
+ while True:
+ line = sys.stdin.readline().strip(",").strip()
+ if line == "[": continue
+ logging.info("input event: {}".format(line))
+ process_event(line, config, update_lock)
def main():
@@ -104,9 +98,13 @@
core.input.register(None, core.input.WHEEL_DOWN, "i3-msg workspace
next_on_output")
update_lock = threading.Lock()
- input_thread = threading.Thread(target=handle_input, args=(output, config,
update_lock, ))
- input_thread.daemon = True
- input_thread.start()
+ event_thread = threading.Thread(target=handle_events, args=(config,
update_lock, ))
+ event_thread.daemon = True
+ event_thread.start()
+
+ cmd_thread = threading.Thread(target=handle_commands, args=(config,
update_lock, ))
+ cmd_thread.daemon = True
+ cmd_thread.start()
def sig_USR1_handler(signum,stack):
if update_lock.acquire(blocking=False) == True:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/core/event.py
new/bumblebee-status-2.1.4/bumblebee_status/core/event.py
--- old/bumblebee-status-2.1.2/bumblebee_status/core/event.py 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/core/event.py 2021-03-18
15:30:03.000000000 +0100
@@ -8,6 +8,13 @@
__callbacks.setdefault(event, []).append(cb)
+def register_exclusive(event, callback, *args, **kwargs):
+ cb = callback
+ if args or kwargs:
+ cb = lambda: callback(*args, **kwargs)
+
+ __callbacks[event] = [cb]
+
def unregister(event):
if event in __callbacks:
del __callbacks[event]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/core/input.py
new/bumblebee-status-2.1.4/bumblebee_status/core/input.py
--- old/bumblebee-status-2.1.2/bumblebee_status/core/input.py 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/core/input.py 2021-03-18
15:30:03.000000000 +0100
@@ -52,9 +52,9 @@
logging.debug("registering callback {}".format(event_id))
core.event.unregister(event_id) # make sure there's always only one input
event
if callable(cmd):
- core.event.register(event_id, cmd)
+ core.event.register_exclusive(event_id, cmd)
else:
- core.event.register(event_id, lambda event: __execute(event, cmd,
wait))
+ core.event.register_exclusive(event_id, lambda event: __execute(event,
cmd, wait))
def trigger(event):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/core/module.py
new/bumblebee-status-2.1.4/bumblebee_status/core/module.py
--- old/bumblebee-status-2.1.2/bumblebee_status/core/module.py 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/core/module.py 2021-03-18
15:30:03.000000000 +0100
@@ -17,6 +17,22 @@
log = logging.getLogger(__name__)
+def import_user(module_short, config, theme):
+ usermod =
os.path.expanduser("~/.config/bumblebee-status/modules/{}.py".format(module_short))
+ if os.path.exists(usermod):
+ if hasattr(importlib, "machinery"):
+ log.debug("importing {} from user via
machinery".format(module_short))
+ mod =
importlib.machinery.SourceFileLoader("modules.{}".format(module_short),
+ os.path.expanduser(usermod)).load_module()
+ return getattr(mod, "Module")(config, theme)
+ else:
+ log.debug("importing {} from user via
importlib.util".format(module_short))
+ spec =
importlib.util.spec_from_file_location("modules.{}".format(module_short),
usermod)
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
+ return mod.Module(config, theme)
+ raise ImportError("not found")
+
"""Loads a module by name
:param module_name: Name of the module to load
@@ -44,16 +60,11 @@
log.debug("importing {} from contrib".format(module_short))
return getattr(mod, "Module")(config, theme)
except ImportError as e:
- usermod =
os.path.expanduser("~/.config/bumblebee-status/modules/{}.py".format(module_short))
- if os.path.exists(usermod):
- try:
- log.warning("failed to import {} from system:
{}".format(module_short, e))
- mod =
importlib.machinery.SourceFileLoader("modules.{}".format(module_short),
- os.path.expanduser(usermod)).load_module()
- log.debug("importing {} from user".format(module_short))
- return getattr(mod, "Module")(config, theme)
- except ImportError as e:
- log.fatal("import failed: {}".format(e))
+ try:
+ log.warning("failed to import {} from system:
{}".format(module_short, e))
+ return import_user(module_short, config, theme)
+ except ImportError as e:
+ log.fatal("import failed: {}".format(e))
log.fatal("failed to import {}".format(module_short))
return Error(config=config, module=module_name, error="unable to load
module")
@@ -179,9 +190,9 @@
:rtype: bumblebee_status.widget.Widget
"""
- def add_widget(self, full_text="", name=None):
+ def add_widget(self, full_text="", name=None, hidden=False):
widget_id = "{}::{}".format(self.name, len(self.widgets()))
- widget = core.widget.Widget(full_text=full_text, name=name,
widget_id=widget_id)
+ widget = core.widget.Widget(full_text=full_text, name=name,
widget_id=widget_id, hidden=hidden)
self.widgets().append(widget)
widget.module = self
return widget
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/core/output.py
new/bumblebee-status-2.1.4/bumblebee_status/core/output.py
--- old/bumblebee-status-2.1.2/bumblebee_status/core/output.py 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/core/output.py 2021-03-18
15:30:03.000000000 +0100
@@ -216,6 +216,8 @@
continue
if module.hidden():
continue
+ if widget.hidden:
+ continue
if "critical" in widget.state() and
self.__config.errorhide(widget.module.name):
continue
blocks.extend(self.separator_block(module, widget))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/core/widget.py
new/bumblebee-status-2.1.4/bumblebee_status/core/widget.py
--- old/bumblebee-status-2.1.2/bumblebee_status/core/widget.py 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/core/widget.py 2021-03-18
15:30:03.000000000 +0100
@@ -10,12 +10,13 @@
class Widget(util.store.Store, core.input.Object):
- def __init__(self, full_text="", name=None, widget_id=None):
+ def __init__(self, full_text="", name=None, widget_id=None, hidden=False):
super(Widget, self).__init__()
self.__full_text = full_text
self.module = None
self.name = name
self.id = widget_id or self.id
+ self.hidden = hidden
@property
def module(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/modules/contrib/shell.py
new/bumblebee-status-2.1.4/bumblebee_status/modules/contrib/shell.py
--- old/bumblebee-status-2.1.2/bumblebee_status/modules/contrib/shell.py
2021-02-20 14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/modules/contrib/shell.py
2021-03-18 15:30:03.000000000 +0100
@@ -47,13 +47,13 @@
self.__output = "please wait..."
self.__current_thread = threading.Thread()
- # LMB and RMB will update output regardless of timer
- core.input.register(self, button=core.input.LEFT_MOUSE,
cmd=self.update)
- core.input.register(self, button=core.input.RIGHT_MOUSE,
cmd=self.update)
+ if self.parameter("scrolling.makewide") is None:
+ self.set("scrolling.makewide", False)
def set_output(self, value):
self.__output = value
+ @core.decorators.scrollable
def get_output(self, _):
return self.__output
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/modules/contrib/stock.py
new/bumblebee-status-2.1.4/bumblebee_status/modules/contrib/stock.py
--- old/bumblebee-status-2.1.2/bumblebee_status/modules/contrib/stock.py
2021-02-20 14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/modules/contrib/stock.py
2021-03-18 15:30:03.000000000 +0100
@@ -3,9 +3,6 @@
"""Display a stock quote from finance.yahoo.com
-Requires the following python packages:
- * requests
-
Parameters:
* stock.symbols : Comma-separated list of symbols to fetch
* stock.change : Should we fetch change in stock value (defaults to True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/bumblebee-status-2.1.2/bumblebee_status/modules/core/keys.py
new/bumblebee-status-2.1.4/bumblebee_status/modules/core/keys.py
--- old/bumblebee-status-2.1.2/bumblebee_status/modules/core/keys.py
1970-01-01 01:00:00.000000000 +0100
+++ new/bumblebee-status-2.1.4/bumblebee_status/modules/core/keys.py
2021-03-18 15:30:03.000000000 +0100
@@ -0,0 +1,56 @@
+# pylint: disable=C0111,R0903
+
+"""Shows when a key is pressed
+
+Parameters:
+ * keys.keys: Comma-separated list of keys to monitor (defaults to "")
+"""
+
+import core.module
+import core.widget
+import core.decorators
+import core.event
+
+import util.format
+
+from pynput.keyboard import Listener
+
+NAMES = {
+ "Key.cmd": "cmd",
+ "Key.ctrl": "ctrl",
+ "Key.shift": "shift",
+ "Key.alt": "alt",
+}
+
+class Module(core.module.Module):
+ @core.decorators.never
+ def __init__(self, config, theme):
+ super().__init__(config, theme, [])
+
+ self._listener = Listener(on_press=self._key_press,
on_release=self._key_release)
+
+ self._keys = util.format.aslist(self.parameter("keys",
"Key.cmd,Key.ctrl,Key.alt,Key.shift"))
+
+ for k in self._keys:
+ self.add_widget(name=k, full_text=self._display_name(k),
hidden=True)
+ self._listener.start()
+
+ def _display_name(self, key):
+ return NAMES.get(key, key)
+
+ def _key_press(self, key):
+ key = str(key)
+ if not key in self._keys: return
+ self.widget(key).hidden = False
+ core.event.trigger("update", [self.id], redraw_only=False)
+
+ def _key_release(self, key):
+ key = str(key)
+ if not key in self._keys: return
+ self.widget(key).hidden = True
+ core.event.trigger("update", [self.id], redraw_only=False)
+
+ def state(self, widget):
+ return widget.name
+
+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bumblebee-status-2.1.2/docs/development/module.rst
new/bumblebee-status-2.1.4/docs/development/module.rst
--- old/bumblebee-status-2.1.2/docs/development/module.rst 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/docs/development/module.rst 2021-03-18
15:30:03.000000000 +0100
@@ -16,7 +16,7 @@
- See below for how to actually write the module
- Test (run ``bumblebee-status`` in the CLI)
- Make sure your changes don???t break anything: ``./coverage.sh``
-- If you want to do me favour, run your module through
+- If you want to do me a favour, run your module through
``black -t py34`` before submitting
Pull requests
@@ -24,7 +24,7 @@
The project **gladly** accepts PRs for bugfixes, new functionality, new
modules, etc. When you feel comfortable with what you???ve developed,
-please just open a PR, somebody will look at it eventually :) Thanks!
+please just open a PR. Somebody will look at it eventually :) Thanks!
Coding guidelines
-----------------
@@ -67,7 +67,7 @@
There are two important concepts for module writers: - A module is
something that offers a single set of coherent functionality - A module
-has 1 to n ???widgets???, which translates to individual blocks in the i3bar
+has 1 to n ???widgets???, which translates to individual blocks in the i3bar.
Very often, this is a 1:1 relationship, and a single module has a single
widget. If that???s the case for you, you can stop reading now :)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bumblebee-status-2.1.2/tests/core/test_output.py
new/bumblebee-status-2.1.4/tests/core/test_output.py
--- old/bumblebee-status-2.1.2/tests/core/test_output.py 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/tests/core/test_output.py 2021-03-18
15:30:03.000000000 +0100
@@ -26,6 +26,7 @@
widget = mocker.MagicMock()
widget.full_text.return_value = "test"
widget.id = "a"
+ widget.hidden = False
return SampleModule(config=core.config.Config([]), widgets=[widget,
widget, widget])
@pytest.fixture
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bumblebee-status-2.1.2/themes/gruvbox-powerline.json
new/bumblebee-status-2.1.4/themes/gruvbox-powerline.json
--- old/bumblebee-status-2.1.2/themes/gruvbox-powerline.json 2021-02-20
14:49:45.000000000 +0100
+++ new/bumblebee-status-2.1.4/themes/gruvbox-powerline.json 2021-03-18
15:30:03.000000000 +0100
@@ -44,29 +44,44 @@
"bg": "#b8bb26"
}
},
- "bluetooth": {
- "ON": {
- "fg": "#1d2021",
- "bg": "#b8bb26"
- }
- },
- "git": {
- "modified": { "bg": "#458588" },
- "deleted": { "bg": "#9d0006" },
- "new": { "bg": "#b16286" }
- },
- "pomodoro": {
- "paused": {
- "fg": "#1d2021",
- "bg": "#d79921"
- },
- "work": {
- "fg": "#1d2021",
- "bg": "#b8bb26"
- },
- "break": {
- "fg": "#002b36",
- "bg": "#859900"
- }
- }
+ "bluetooth": {
+ "ON": {
+ "fg": "#1d2021",
+ "bg": "#b8bb26"
+ }
+ },
+ "git": {
+ "modified": { "bg": "#458588" },
+ "deleted": { "bg": "#9d0006" },
+ "new": { "bg": "#b16286" }
+ },
+ "pomodoro": {
+ "paused": {
+ "fg": "#1d2021",
+ "bg": "#d79921"
+ },
+ "work": {
+ "fg": "#1d2021",
+ "bg": "#b8bb26"
+ },
+ "break": {
+ "fg": "#002b36",
+ "bg": "#859900"
+ }
+ },
+ "keys": {
+ "Key.cmd": {
+ "bg": "#8ec07c",
+ "full_text": "***"
+ },
+ "Key.shift": {
+ "bg": "#fabd2f"
+ },
+ "Key.ctrl": {
+ "bg": "#83a598"
+ },
+ "Key.alt": {
+ "bg": "#f28019"
+ }
+ }
}