Matthieu Coudron
c5933a3b26
This commit adds a basic test to check callbacks work.
...
This can also serve as an exemple.
2014-12-21 13:31:40 +01:00
Matthieu Coudron
12546736a6
Fix in documentation
2014-12-20 15:46:34 +01:00
Matthieu Coudron
d31cc380ef
Follow up of https://github.com/enkore/i3pystatus/pull/149#issuecomment-67712619 .
...
This commit removes and replaces all the old methods 'on_*' by settings
with the same name. The old methods were renamed into more explicit names that can be used for the callbacks like "next_song","mute" etc...
For instance, you can test with:
status.register("clock",
format=[
("Format 0",'Europe/London'),
("%a %-d Format 1",'Europe/Dublin'),
"%a %-d %b %X format 2",
("%a %-d %b %X format 3", 'Europe/Paris'),
],
on_leftclick= ["urxvtc"] , # launch urxvtc on left click
on_rightclick= ["scroll_format", 2] , # update format by steps of 2
log_level=logging.DEBUG,
)
This way much code could be removed from other modules, though I did it only for the clock module here.
2014-12-20 15:30:41 +01:00
Matthieu Coudron
98e46ac3d6
Updated alsa & clock modules with new mechanism
2014-12-19 22:04:49 +01:00
Matthieu Coudron
14c0528be5
This commit introduces a skeleton that allows personalized callbacks in
...
a backwards compatible way. Settings 'on_lclick','on_rclick',
'on_scrollup','on_scrolldown' are inherited by all modules.
These parameters should be a string. Then when a matching action is
detected (ie mouseclick, scrolling), the module check if this string
corresponds to a:
1/ python callable
2/ module method,
In cases 1 and 2, it calls the python function with the module as the
first parameter. Otherwise it considers the string is an external command and launches it via run_through_shell
2014-12-19 18:52:15 +01:00
Matthieu Coudron
9e3f128a15
This commit improves the logging system: instead of setting a boolean to enable logging, the user sets a logging level (per module). By default only critical errors are logged (ie nothing for now).
...
Also adds a test for the function run_through_shell
2014-12-18 18:42:58 +01:00
Matthieu Coudron
69c1cd6460
Various pep8 and comments removal + converted shell module to use run_through_shell command
2014-12-18 00:26:24 +01:00
Matthieu Coudron
bc15eb4e6b
i3pystatus creates a logger that can be imported via import i3pystatus.logger . Thus when modules enable the 'enable_log' setting, it should log i3pystatus errors to a file called '.i3pystatus-<pid>'. This commit only solves the case when email_client was called in the email module and would output things into stderr/stdout.
2014-12-17 23:39:10 +01:00
Matthieu Coudron
cb25cb5fb3
Fix error generated by sphinx-build complaining of no end for the list
2014-12-17 18:18:08 +01:00
Matthieu Coudron
f440322b36
Settings will be inherited between modules
2014-12-17 00:48:49 +01:00
enkore
a2bb10443c
mimimi - 1.5.6 doesn't complain about that. interesting.
2014-10-14 17:40:16 +02:00
enkore
9e06145389
PEP 8 (I'm bored): core/util
2014-10-14 16:51:58 +02:00
enkore
b2b34ad81a
PEP 8 (I'm bored): core/modules
2014-10-14 16:50:40 +02:00
enkore
8db7b1d160
PEP 8 (I'm bored): core/io
2014-10-14 16:50:08 +02:00
facetoe
55810e1431
Added method to draw a vertical bar made of Unicode characters.
2014-10-12 12:10:03 +08:00
enkore
9fd557915c
Update util.py
2014-10-11 13:03:04 +02:00
facetoe
d14e7ddadc
Documented dependencies on the PyPI colour module.
2014-10-11 18:54:12 +08:00
facetoe
20363b9da0
Moved color code into it's own class that other classes can inherit
...
from.
2014-10-11 16:02:04 +08:00
facetoe
48821e34ca
Moved get_hex_color_range() from util.py to network_graph.py to prevent
...
breaking the build.
2014-10-11 14:52:08 +08:00
facetoe
3901aa43f1
Added method to generate a list of hex color values between a start
...
color and end color.
2014-10-11 13:17:02 +08:00
facetoe
a77b06a25e
Added method for printing a graph of Unicode characters.
2014-10-06 19:23:32 +08:00
Tom X. Tobin
c8b4dc0466
Fix internet() test function
...
The change in commit 6989713
broke the internet() test function by
trying to access the DNS port of "www.google.de", causing it to always
return False, which in turn broke all modules calling it. We instead use
the actual domain name of Google's DNS server at IP "8.8.8.8".
2014-09-14 17:15:50 -04:00
Matthieu Coudron
000bdc6978
i3 next branch send click events on mouse wheel up/down. This patch allows to change the alsa volume with the mousewheel when hovering the alsa indicator
2014-08-30 00:13:57 +02:00
enkore
6989713d6c
Require working DNS for internet connectivity
...
Relates to #102
2014-08-28 16:13:52 +02:00
enkore
eee14260f4
Alternative exception handling
...
Related #102 #100 and others
2014-08-28 16:11:53 +02:00
enkore
f50e6c1cf7
core Status docs
2014-08-15 14:24:11 +02:00
Arvedui
cee58e495c
prevents start of command_endpoint thread when click_events are disabled
2014-08-15 00:16:50 +02:00
Arvedui
de3db6fb19
added option for disabeling click events
2014-08-15 00:12:18 +02:00
enkore
6de38c933f
Confirmed #74 fixed, close #74
2014-08-04 18:21:16 +02:00
enkore
c0da4fce06
Possible fix for #74
2014-07-26 21:39:52 +02:00
Chris Wood
33aba4b084
Add user_open() function
2014-07-17 00:59:27 -04:00
eBrnd
a5b4ad0b1c
add bar drawing function, and modules for showing cpu and ram usage as a bar
2014-06-14 20:18:12 +02:00
Andrés Martano
29cdbf72b8
Allow round to INT
...
In round_dict, if places is None, round to INT.
2014-05-10 10:40:00 -03:00
enkore
f06a76ad52
PEP8
2014-04-30 14:51:41 +02:00
enkore
4109515914
Some documentation stuff
2014-04-23 14:45:29 +02:00
Łukasz Jędrzejewski
5fe6d049d2
Configurable interval for every IntervalModule
...
settings attribute for every class inheriting from IntervalModule are
automatically extended by interval setting if it does not exist.
A function to flatten settings in SettingsBase was extracted and added
as a static method.
2014-03-10 17:06:40 +01:00
enkore
c43a22c46d
Optimize imports
2013-10-31 22:33:18 +01:00
enkore
cdf9176258
Reformat
2013-10-30 10:46:04 +01:00
enkore
d9e3dec0c2
Catch ConfigError in register()
2013-10-30 10:41:08 +01:00
enkore
1295bf1ec5
exceptions: define format in ABC
2013-10-23 21:52:44 +02:00
enkore
32e68eb14d
Modulelist.get
2013-10-23 21:36:20 +02:00
enkore
467339e905
Remove __repr__ from Module
2013-10-23 21:36:12 +02:00
enkore
b89b8a8145
core.desktop: Refactor into class
...
TODO: find better way to handle Impl
2013-10-23 21:36:05 +02:00
enkore
c33cb3aa60
CommandEndpoint docs
2013-10-23 21:35:50 +02:00
enkore
135915ac96
Remove call_start_hooks and START_HOOKS #27
2013-10-23 21:08:49 +02:00
enkore
2895aa44cf
Refactor run_command_endpoint into class
2013-10-23 21:06:52 +02:00
enkore
266084801d
Delete Module.test() #27
2013-10-23 21:06:31 +02:00
enkore
6d9494acff
Delete config module #27
2013-10-23 21:06:14 +02:00
enkore
3d484694bd
Remove unneeded stuff
2013-10-23 17:16:04 +02:00
enkore
8fe5c77acd
ModuleList: Remove hard dependency on ClassFinder
2013-10-23 17:14:08 +02:00