Commit Graph

221 Commits

Author SHA1 Message Date
enkore
4dd0d0b7c3 ClassFinder: fixed missing imports 2013-10-23 17:12:39 +02:00
enkore
5c0d994006 Remove import 2013-10-23 17:04:32 +02:00
enkore
a1c12a3620 id always returns int 2013-10-23 16:56:12 +02:00
enkore
ead0285ecc Remove trivial & single-usage chain decorator 2013-10-23 16:55:10 +02:00
enkore
5eb271c684 Remove PrefixedKeyDict (unused) 2013-10-23 16:54:51 +02:00
enkore
1de1eaae87 Rename ModuleList.get_by_id to get_module_by_id 2013-10-23 16:54:30 +02:00
enkore
67faff6e0f Handling ImportError in Status.register() (#22) 2013-10-23 09:50:14 +02:00
Jan Oliver Oelerich
55e070f36b removed import of parse_json
caused an error.
2013-10-19 19:12:06 +02:00
enkore
a5dc101a19 Docstring for chain 2013-10-18 19:23:50 +02:00
enkore
26165647e3 Remove unused render_json 2013-10-18 19:23:41 +02:00
enkore
a983a744be remove some debugging stuff from formatp 2013-10-18 19:23:15 +02:00
enkore
130f103d07 TimeWrapper docs 2013-10-17 23:24:51 +02:00
enkore
eb661a0ebb More docs 2013-10-17 21:42:52 +02:00
enkore
35a0096974 Some docs 2013-10-17 19:18:35 +02:00
enkore
e788d83255 core.util: Add require and internet 2013-10-17 16:31:26 +02:00
enkore
0d93f165b3 Sphinx warning 2013-10-14 18:51:52 +02:00
enkore
3381959e6b Sphinx 2013-10-14 17:55:41 +02:00
enkore
78c01dd3e5 PEP8 2013-10-01 15:22:09 +02:00
enkore
72f1c04c57 (PyCharm) 2013-10-01 13:10:48 +02:00
enkore
5184958179 core: remove unreachable code 2013-10-01 13:05:03 +02:00
enkore
ef4db339de core: add threading module 2013-10-01 13:04:54 +02:00
enkore
7f57950478 core: remove render module 2013-10-01 13:04:47 +02:00
enkore
a3d86e7a44 core: remove threading package 2013-10-01 13:04:00 +02:00
enkore
69b702d2f1 3.24: Introduce time wrapper, remove battery remaining_* formatter(!!!) 2013-08-04 23:40:19 +02:00
enkore
3394aa56ea Change relative to absolute imports (style) 2013-08-04 17:56:04 +02:00
enkore
ea1cbe9a0c 3.23: Fixed core.util.formatp (also added core.util.flatten for this fix) 2013-08-04 17:25:04 +02:00
enkore
c3441da72e core.desktop: make dependency python-gobject optional 2013-08-03 14:24:37 +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
d2f6dd97a5 3.12: Fixed test command 2013-03-23 22:05:46 +01:00
enkore
c5413c4243 Module.move should return self 2013-03-23 22:02:46 +01:00
enkore
c41c2736bf Adjust to newest i3bar patch 2013-03-21 12:35:28 +01:00
enkore
1171a1d0ae Change Module.test API to something more intuitive
(I mean, what the hell has crossed my mind to name a method *test*
and let it return FALSE if successful? :D)
2013-03-16 12:58:01 +01:00
enkore
0e90cbfceb Merge branch 'master' of github.com:enkore/i3pystatus 2013-03-16 12:40:21 +01:00
enkore
a6810840ae Fix core.threading.wrapper 2013-03-16 12:40:09 +01:00
enkore
b662d8797e Add Module.test 2013-03-16 12:39:17 +01:00
philipdexter
60c475d6e6 Add the option of specifying python-ish negative array indices to the move method 2013-03-15 21:34:45 -04:00
philipdexter
ecb6c54052 Add the ability to change the position of a module in the i3bar
Create a method `move' in modules.py to insert the module's json in a different position than the default 0.
2013-03-15 21:20:24 -04:00
enkore
59437c1707 ClassFinder can also instanciate classes now. 2013-03-11 17:08:38 +01:00
enkore
c340b2cf75 Changed Config.test 2013-03-11 00:28:24 +01:00
enkore
a5b274fd23 PEP 8 and stuff 2013-03-11 00:21:54 +01:00
enkore
c259a653ae Refactor the config part 2013-03-11 00:21:27 +01:00
enkore
0a32494ce8 3.12: More bullet-proof wrapper 2013-03-10 21:38:02 +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
c60d2fd3df Should definitely test KeyConstraintDict.
Seems to be all ok so far, just needed to add __delitem__
2013-03-08 16:59:59 +01:00
enkore
9084661a5d Rewrote core.util.partition, added tests for it. 2013-03-08 15:53:48 +01:00
enkore
237123ae0f Small changes in battery module 2013-03-08 15:53:28 +01:00
enkore
7a0bb1cbaa Fix issue with gobject&gobject2
summary: just don't ever use gobject and gobject2 at the same time...
2013-03-06 22:32:07 +01:00
enkore
df0982ad84 Fix & close #6
Paradigm: "I don't know what to do, so let's outsource it"
2013-03-06 18:02:46 +01:00
enkore
553ad4efb9 2013-03-06 13:14:28 +01:00
enkore
0cd3e266c3 Add parcel module (currently only suppotr for DHL)
Needs documentation, extension, some redesign/separation of concern,
and lxml
2013-03-06 00:02:49 +01:00
enkore
93bfab1d7b #5: Support for real config files 2013-03-05 23:07:50 +01:00
enkore
6740f5b1cc #5: Add slim wrapper for notifications 2013-03-05 17:26:28 +01:00
enkore
03d96ad0ea Some internal code butchering again. 2013-03-05 17:26:10 +01:00
enkore
3cac448f6e Change process title of threads to something meaningful, if setproctitle is installed. 2013-03-02 20:05:41 +01:00
enkore
3c284ad29c Docstrings and such 2013-03-02 17:34:53 +01:00
enkore
3ebcbec4e1 i3pystatus.core.threads ; some smaller changes. 2013-03-02 17:34:32 +01:00
enkore
901dd4319f New self-organizing/self-optimising threading model (no API changes)
Using a simple, hysteresis based approach… currently in this first
version the optimizer recursively moves modules out of a thread until a
certain timing target is reached; the "modules moved out" just mentioned
are then partitioned into new threads according to their latest time profile.

Very simple, but very effective.
Todo: Implement merging threads with (again) good behaving workloads.
2013-02-28 00:14:51 +01:00
enkore
604a4f8e29 disk module 2013-02-26 23:00:03 +01:00
enkore
9510f0b1c0 Added ability to automatically import modules
I thought: Well, isn't it a bit redundant if I go ahead and say in my
config "import this-n-that and temp and load and alsa" while later
just giving register() the modules.
So register() (/ClassFinder as the backend) now support just naming a
module as the first parameter. That module is then imported and
searched for a class as usual.

Just for reference the synopsis of Status.register():

register(mod.SomeChecker())
register(mod, setting1=..., setting2=...)
register(mod, {"setting1:":, "setting2":...})
register("mod", setting=1..., setting2=...)
register("mod", {"setting1:":, "setting2":...})

Fun fact: Actually register() doesn't care for it's arguments.
They're passed straight into ClassFinder.instanciate_class_from_module
(something I should definitely rename), which checks if it's first
parameter is one of:
-Python module
 => It calls ClassFinder.get_class with the same parameters
   => get_class will search the module using ClassFinder.search_module
      and return a matching class if and only if there is a single matching
      class in the module
-string
 => It calls ClassFinder.get_module to import the module and calls itself
  on the result
-something else
 => It returns that something

The actual variation in passing the settings (keyword arguments vs. dict)
is handled in SettingsBase.
2013-02-26 00:56:09 +01:00
enkore
a89b421ebb battery 2013-02-24 21:46:29 +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