Commit Graph

49 Commits

Author SHA1 Message Date
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
enkore
e3829b5700 We were finally successful in moving the input loop
to the lower I/O layer.
This means we unified the loop with it's implicit abort
condition (end of stream or ^C).
2013-02-18 19:15:27 +01:00
enkore
6ff3e8ebf3 One may want to change the ordering
("injecting" items in the middle of i3status output, for example)
2013-02-18 18:06:08 +01:00
enkore
143d7d1a40 Turns out, i3bar doesn't care for "None". One conditional less <3 2013-02-18 18:03:54 +01:00
enkore
0ad4ae6a02 This isn't a program... this is a poem! 2013-02-18 18:02:23 +01:00
enkore
1d4403e308 Let's remove that synchronous functionality alltogether.
It simply isn't in the spirit of this app :-)
And nobody uses it.
2013-02-18 18:00:16 +01:00
enkore
84fdbfaff3 Using a context here is much... smoother
exploited_language_features += 2;

(I also exploit the mutability of the list-object here,
yield j binds the list to the context,
when the context is leaved execution continues and the
modified j is written back)
2013-02-17 14:02:55 +01:00
enkore
797333e7ac Added some magic to JSONIO 2013-02-17 13:57:22 +01:00
enkore
60b5def7d9 Splitted IO handling even a bit more :-) 2013-02-17 01:25:41 +01:00
enkore
ab5afd0227 Moved IO handling out of main class
(for reusability; I use that piece of code now elsewhere
and want to keep that easily in sync)
2013-02-17 01:19:04 +01:00
enkore
973abc928e Support for external file descriptors.
Allows to run i3status directly from your __main__, like this:

    status.register(...) # and so on

    process = subprocess.Popen("i3status", stdout=subprocess.PIPE)
    status.fd = process.stdout

    # start the handler
    status.run()
2013-02-17 00:55:25 +01:00
enkore
2c7b0fcef9 Added yet another module type, fixed notmuch module
(Yeah, I'm really lazy today)
2013-02-15 21:06:52 +01:00
enkore
8ec1972a3e Replaced conditionals with polymorphism 2013-02-15 18:38:50 +01:00
enkore
561e60efee Consistent quotes 2013-02-15 18:38:18 +01:00
enkore
922ae49aba Create package i3pystatus 2013-02-12 01:07:26 +01:00