Commit Graph

64 Commits

Author SHA1 Message Date
Igor Sharonov
0a3679510e Treat i3pystatus as launcher 2016-06-19 22:18:07 +03:00
enkore
58ca67109c Change default mode to standalone=True 2016-02-12 14:12:43 +01:00
enkore
289c090ea4 Import core.util.get_module into i3pystatus main module 2016-02-02 15:47:18 +01:00
enkore
c5fe29d258 Always log to file in home dir 2015-06-08 02:41:34 +02: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
enkore
f06a76ad52 PEP8 2014-04-30 14:51:41 +02:00
enkore
c43a22c46d Optimize imports 2013-10-31 22:33:18 +01:00
enkore
6a749bb03a Add i3pystatus binary 2013-10-30 18:38:11 +01:00
enkore
a5b57601da Make i3pystatus a namespace package 2013-10-30 10:35:24 +01:00
enkore
657cc87429 Delete main() #27 2013-10-23 21:06:04 +02:00
enkore
78c01dd3e5 PEP8 2013-10-01 15:22:09 +02:00
enkore
ac2ed844ac Add 'Formatting' chapter to README 2013-08-03 14:40:57 +02:00
enkore
d5d0b19330 Add core.util.formatp (this is going to be good) 2013-08-03 03:18:24 +02:00
enkore
42ab76dd3a Invocation changed
-t/--test run test
-c/--config specify config file
2013-07-31 01:31:13 +02:00
enkore
c259a653ae Refactor the config part 2013-03-11 00:21:27 +01:00
enkore
b42cd6aa15 3.12: Move code around 2013-03-10 21:22:58 +01:00
enkore
19aca9149a 3.12: remove I3statushandler 2013-03-10 20:57:12 +01:00
enkore
7dfac95f1e 3.11: Add test command, invoke like this: i3pystatus test 2013-03-10 18:24:33 +01:00
enkore
c8c8e2226f Improved UX a bit: all threads are immediately started;
no more slow starting of modules.

Although I'm highly unsatisfied with the current implementation
(SoC, you hear me!?)
2013-03-10 02:11:58 +01:00
enkore
375ba3af7b Support for the 3rd version of the i3bar-onclick-patch 2013-03-10 01:27:23 +01:00
enkore
657bdb826a Add preliminary(!) support for bidirectional communication with i3bar
Novelty use only.
2013-03-09 21:23:36 +01:00
enkore
93bfab1d7b #5: Support for real config files 2013-03-05 23:07:50 +01:00
enkore
8ebca17e79 Aaand some code butchering I forgot earlier. 2013-03-05 17:27:12 +01:00
enkore
a892a09581 Moving some code around. 2013-02-24 21:00:16 +01:00
enkore
1fd53cd60a Add ModuleList 2013-02-24 20:20:15 +01:00
enkore
92b2af56a8 Removed ModuleFinder, changed ClassFinder
ClassFinder:
Removed exclude argument, which is basically covered with
obj.__module__ == module.__name__ which ensures that no imported
classes are found, which was the only use case for exclude.
2013-02-24 20:16:33 +01:00
enkore
a2104f5d2f Removed support for indicating the position of a module 2013-02-24 20:13:57 +01:00
enkore
1b6498883b Divided __init__ into some submodules
This didn't change the public "API" used by modules.

.core.io contains the IO classes, namely IOHandler, StandaloneIO and JSONIO

.core.util contains SettingsBase and ClassFinder

.core.exceptions contains all custom exceptions
2013-02-24 18:43:00 +01:00
enkore
a06c4ef580 Moved backlight into submodule 2013-02-24 15:25:11 +01:00
enkore
ed003c123f temp module 2013-02-24 00:34:16 +01:00
enkore
c4db62d2a4 Some small changes 2013-02-23 23:50:50 +01:00
enkore
3677ffc852 Rewrote SettingsBase 2013-02-23 23:48:48 +01:00
enkore
c96410e92d Automagic name attribute in JSON output
If name is not set by the module, it's set automatically to the
fully qualified python dotted path to the module :-)
2013-02-23 20:52:07 +01:00
enkore
dd7b5ef346 i3bar has some issues with locale-handling I guess.
It reliably crashes i3pystatus, but only if started by i3bar. Meh.
I can't tell if this locale issue is local (ha-ha) or everyone is affected.
2013-02-23 20:41:42 +01:00
enkore
ebe3d718e3 Reworked exceptions 2013-02-23 20:15:20 +01:00
enkore
d31fe9a62d Moving code around a bit 2013-02-23 18:40:59 +01:00
enkore
1cdc722f46 SettingsBase 2013-02-23 17:40:35 +01:00
enkore
7c8fcb8758 Refactored the "find appropiate class" part a bit 2013-02-23 15:03:21 +01:00
enkore
efb2b31ee8 StandaloneIO 2013-02-23 14:09:23 +01:00
enkore
26cc3ff27a . 2013-02-23 14:06:55 +01:00
enkore
a1b84b74d2 Fixed issue with standalone usage 2013-02-23 13:54:35 +01:00
enkore
a354a8288e Configuration shortcut
You can now pass a module (the Python thing, e.g. modsde) into register
and it will just "do the right thing" (find a class derived from Module
in that module and instanciate it with any extra arguments)
2013-02-23 13:53:54 +01:00
enkore
c967cdecb2 Settings system. Now is probably the right moment to tell if you don't like it :) 2013-02-23 00:11:02 +01:00
enkore
5474980b11 Support for standalone operation
Specify standalone=True to the I3statushandler constructor
to run i3pystatus without i3status in the background.
i3pystatus won't read input from stdin or any other
file object specified with input_stream.

The keyword argument interval specifies how often output should
be generated. The default is 1 (second).


Sorry guys for changing the way i3pystatus "way of operation"
is set so often. If you're want the "self-contained" mode
(you execute i3pystatus, i3pystatus automatically starts
i3status), don't set the file attribute, but pass the file
descriptor of the pipe as input_stream like this:

process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE, universal_newlines=True)
status = i3pystatus(input_stream=process.stdout)

On a side note:
The main class name has been changed to i3pystatus, but I3statusHandler
is still available as an alias. Use whichever you prefer :-)
(Linux is about choice after all)
2013-02-22 21:23:58 +01:00
enkore
8a1041ac0e Merge branch 'master' of https://github.com/janoliver/i3pystatus 2013-02-22 18:14:05 +01:00
Matthias Pronk
0adbc0ad28 remove unused import 2013-02-22 14:11:05 +01:00
enkore
4966f90775 .dist 2013-02-21 16:08:52 +01:00
enkore
99b1e003cb Fixed crash if used with normal pipe
If one wants to run i3status as a subprocess of
i3pystatus, do it like this:

import subprocess
import io
...
process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE)
stdin = io.TextIOWrapper(process.stdout)
status = I3statusHandler(stdin)
2013-02-21 14:05:11 +01:00