Commit graph

74 commits

Author SHA1 Message Date
tobi-wan-kenobi
b42323013d fix(config): make config file keys case sensitive
Since the configparser library by default parses keys case insensitive
(all lowercase), certain mappings, especially in the pulseaudio modules,
could fail ("internal" pulseaudio device names are matched against
entries in the configuration).

fixes #992
2023-09-15 15:06:57 +02:00
tobi-wan-kenobi
38613495f2 [tests] Adjust for widget hiding 2021-03-13 20:44:36 +01:00
tobi-wan-kenobi
af95b2e276 [tests] fix syntax error 2020-12-27 14:52:45 +01:00
tobi-wan-kenobi
960792b2e5 [tests] fix module load test for python 3.6 and further 2020-12-27 14:49:12 +01:00
tobi-wan-kenobi
9136ebd321 [core/input] clear previous input registrations
make sure that for a given event (widget/object/module, whatever), only
a *single* input event per button can be registered at one time.

the problem otherwise is with modules that re-register their widgets
with the same IDs (cmus, spotify, etc.): Each time the widget is
re-created (each intervall, typically), it re-registers an input event,
creating an always longer list of callbacks being executed when the
button is clicked (not speaking of the memory leak this introduces).

fixes #668
2020-06-29 07:44:22 +02:00
Tobias Witek
441e7d5041 [core] fix minimize for all modules (nic, traffic, etc.)
make it possible to toggle the display state of a widget between
"displayed" and "minimized" also for modules that re-create their
widgets during each iteration.

see #661
2020-06-23 20:03:17 +02:00
Tobias Witek
34dadadf90 [core] re-enable minimize of widgets
by default, allow toggling the minimized state of a widget via the
middle mouse and draw a single unicode char instead of the actual
widget, maintaining all states.

fixes #661
2020-06-23 15:51:14 +02:00
Tobias Witek
79fb28512f [tests] black -t py34 2020-06-20 15:11:53 +02:00
Tobias Witek
39fa7788b4 [tests] switch to pytest 2020-06-20 14:53:44 +02:00
Tobias Witek
b2e92d816d [tests] add pytest for core.output
see #642
2020-06-20 14:51:49 +02:00
tobi-wan-kenobi
16269ff01e [core/input] add variables to custom cli calls
when specifying event bindings via CLI (e.g. disk.left-click=thunar),
allow for variables ({instance} and {name}, in particular).

fixes #650
2020-06-09 20:29:51 +02:00
tobi-wan-kenobi
cb9a60668a [core/theme] Fix detection of "best matching theme"
Previous code accepted the "first" hit in a theme - particularly, if a
module is called "A" and a *different* module "B" uses "A" as state, a
widget of module B with state A would be themed as *module* A, wrongly.

Essentially, made sure that the last (most specific) themeing "wins".

fixes #647
2020-06-04 20:56:31 +02:00
tobi-wan-kenobi
02a80840a1 [core] more black'ing 2020-05-16 12:00:55 +02:00
tobi-wan-kenobi
7584366adc [tests] add more tests 2020-05-16 11:57:27 +02:00
tobi-wan-kenobi
eea3c758de [core/input] Invoke commands in a subshell
add shell capability to util.cli and make sure that the input module
uses that to reliably spawn whatever command the user wants to run.

see #628
2020-05-16 11:43:43 +02:00
Pavle Portic
a8df4a5f9d
Handle n+1 characters in the scrolling decorator 2020-05-15 20:31:37 +02:00
tobi-wan-kenobi
526560ea54 [core/decorators] use difflib to make scrolling reset detection fuzzy
when scrolling text that is subject to *slight* changes (e.g. a song
that contains the current position within the song), allow for slight
variations in the displayed text.

fixes #629
2020-05-14 20:35:09 +02:00
tobi-wan-kenobi
92577e7d26 [all] black code :) 2020-05-09 21:24:28 +02:00
tobi-wan-kenobi
320827d577 [core] restructure to allow PIP packaging
OK - so I have to admit I *hate* the fact that PIP seems to require a
subdirectory named like the library.

But since the PIP package is something really nifty to have (thanks to
@tony again!!!), I updated the codebase to hopefully conform with what
PIP expects. Testruns so far look promising...
2020-05-09 21:22:00 +02:00
tobi-wan-kenobi
1d25be2059 [doc] update module documentation 2020-05-09 15:31:25 +02:00
tobi-wan-kenobi
9ef826b5fd [core] fix tests 2020-05-08 21:01:45 +02:00
tobi-wan-kenobi
98dd8ca5f7 [core/decorators] reset scrolling if content changes
see #622
2020-05-04 20:11:10 +02:00
tobi-wan-kenobi
30c1f712a6 [formatting] reformat using "black -t py34"
getting rid of thinking about consistent formatting...
2020-05-03 11:15:52 +02:00
tobi-wan-kenobi
4bd23950c6 [tests] add core/widget tests 2020-05-02 14:14:12 +02:00
tobi-wan-kenobi
5ee97dbb09 [tests] add more core/config tests 2020-05-02 14:09:30 +02:00
tobi-wan-kenobi
2ab575d190 [core] do not scroll errors
to make errors easier to diagnose, do not scroll them, but instead fully
show them.

also, re-introduce the supplementary fields for the dwm bridge, kudos to
@somospocos
2020-05-01 15:34:29 +02:00
tobi-wan-kenobi
1e4955d4b8 [core/module] Make name and module_name attributes 2020-04-30 12:50:24 +02:00
tobi-wan-kenobi
9cd9ff626d [core] make widget name an attribute
first, this fixes #607

also, i think it slightly simplifies code to make "simple" stuff like
names, etc. attributes instead of methods all the time.

so, expect this to be extended to other components, as well.
2020-04-30 12:42:34 +02:00
tobi-wan-kenobi
1f94eab927 [core] Add themes to module constructor 2020-04-26 16:39:13 +02:00
tobi-wan-kenobi
580bb20a9f [tests/theme] Fix WAL mocked tests
Until now, the WAL tests depended on the pyWAL cache file being actually
present on the system.
2020-04-13 13:47:50 +02:00
tobi-wan-kenobi
dc5bfd1fc6 [tests/output] Improve pango tests 2020-04-13 13:43:07 +02:00
tobi-wan-kenobi
9e32cdef5d [core] Rename events for more clarity 2020-04-12 20:11:02 +02:00
tobi-wan-kenobi
4cd6444bbf [core/theme] Improve items that are lists
Until now, using a list as prefix/suffix didn't work as expected,
because the corresponding method for retrieving the value was called
multiple times, and each time, the next icon would be retrieved.

Changed the logic inside the theme to only update the indices every time
that an actual update was happening.
2020-04-12 14:01:51 +02:00
tobi-wan-kenobi
32e5d633f4 [core/output] Add tests for pango formatting 2020-04-07 20:59:26 +02:00
tobi-wan-kenobi
c0cc1ccd75 [core] Remove "intelligent" theme accessors
To simplify code, remove the auto-generated theme accessors for
attributes, and instead use a generic "get" method.
2020-04-07 20:44:01 +02:00
tobi-wan-kenobi
37cca1c3b9 [core/output] Fully switch to i3 block abstraction
According to the unit tests, at least, the old functionality is back
again - with the additional i3 block abstraction in output in place.

Also, pango support is temporarily removed again and will be
re-implemented based on the new architecture.
2020-04-05 13:58:59 +02:00
tobi-wan-kenobi
a43917594e [tests/event] Add some more tests for trigger-time args 2020-04-04 08:44:41 +02:00
tobi-wan-kenobi
52e5ad7b43 [core/input] Handle exceptions for non-existent commands 2020-04-04 08:17:35 +02:00
tobi-wan-kenobi
77443b7802 [tests/theme] Add more theme tests 2020-04-04 08:03:03 +02:00
tobi-wan-kenobi
0f6dfb3f1a [core/input] do not throw on wrong event type
until now, if a module had registered callbacks, events for nonexistent
buttons caused the trigger mechanism to raise an exception.
2020-04-02 16:21:07 +02:00
tobi-wan-kenobi
885cc09636 [core/output] Add some more tests 2020-03-31 20:57:09 +02:00
tobi-wan-kenobi
95410e4adf [core/input] __ for private variables, use id as property 2020-03-29 14:43:04 +02:00
tobi-wan-kenobi
2a93a001b2 [theme] Add unit tests for WAL loading 2020-03-28 14:51:48 +01:00
tobi-wan-kenobi
5ade8e47f0 [core/theme] Add some unit tests 2020-03-28 14:03:50 +01:00
tobi-wan-kenobi
908ef67109 [core/widget] bump test coverage 2020-03-27 13:54:22 +01:00
Tobias Witek
9755a70578 [tests] Make tests pass again (configurable update interval) 2020-03-23 15:40:53 +01:00
Tobias Witek
48c21a902e [tests/module] Skip failing tests in Python 3.{4,5} 2020-03-06 14:45:09 +01:00
Tobias Witek
efc2e4f94e [modules] Separate modules into core & contrib
Also, improve errors when importing a module fails.

Also, add more tests.
2020-03-06 14:14:34 +01:00
Tobias Witek
47950240d0 [tests/core/module] Add tests for widget retrieval by name 2020-03-05 21:17:06 +01:00
Tobias Witek
d19eb72296 [tests/module] Test generation of error widget
When a module/widget throws, an error widget should be produced.
2020-03-04 21:06:09 +01:00