-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from PR #14 #15
Conversation
* If the player is disconnected, let the user know (i.e. print a message that says `'(no player)'`). * Propagate KeyInterrupt exceptions properly (important for launcher's to properly handle interruptions and redirect interruptions; i.e. if the launcher is interrupted, the launcher can in turn interrupt the sub-process). * `MPRISBlocket._instances` can be a `set` instead of a dictionary. Dictionaries where values are always True can always be translated to sets (and sets also have O(1) time look-ups). * `bus_name_has_owner(bus_name=None)` was always equivalent to `bus_name_has_owner(bus_name=self._bus_name)`, removed the redudancy by removing the default value and always passing an explicit value * moved null check guard within stop_stdin_read_loop, reducing cyclomatic complexity of MPRISBlocket.run
i3blocks_mpris.py
Outdated
self._instances = set() | ||
# a dict used as an ordered set, keys — well-known names with unique | ||
# instance suffixes, values — True | ||
self._instances = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! sorry about this part of the change, my understanding was that dictonaries had no guaranteed order! but that was an old thing (prev to 3.7).
https://docs.python.org/3.7/library/stdtypes.html#dict
At the moment of writting, at the very bottom of this section there is this note:
Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.
@@ -240,8 +240,6 @@ def run(self, *, loop=None, read_stdin=True, nowait=False): | |||
self.start_stdin_read_loop() | |||
try: | |||
self._loop.run() | |||
except KeyboardInterrupt as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right... (facepalm)
See: #14