summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* plugin_registry: dedicated method for "make namespaced symbol"Jan Pokorný2014-09-091-1/+5
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: fix always-true misuse of assert stmtJan Pokorný2014-09-091-2/+2
| | | | | | | | | | Apparently, comma-separated values -> tuple is preceded with assert statement syntactic closure recognition, hence pair of arguments to assert cannot be enclosed with parentheses (previous assumption was that it is the same due to syntactically both notations are equivalent). Reported-by: Tomáš Jelínek" <tojelinek@redhat.com> Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* tests/command: apply Approved Formatting Convention (TM)Jan Pokorný2014-09-051-6/+6
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* Make CLI interface work again after bfbb5c8(?)Jan Pokorný2014-09-053-6/+8
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command_manager: remove remnant of commit bfbb5c8Jan Pokorný2014-09-051-1/+0
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filters/xml2simpleconfig: add a note wrt. non-bijectivityJan Pokorný2014-09-051-0/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* utils: sanitize args2tuple (OMG)Jan Pokorný2014-09-051-1/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: sanitizeJan Pokorný2014-09-051-1/+5
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command_manager: 'implicit' superseded (by far) with 'init_lookup'Jan Pokorný2014-09-053-16/+7
| | | | | | + reflect that in tests Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* {command,filter}_manager: finalize "pick what's needed"Jan Pokorný2014-09-052-3/+18
| | | | | | | | ... by automatically instructing underlying layer to obtain symbols necessary for successful resolution of plugins in higher level (commands - filters - formats). Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: lib-use-convenience/pick what's neededJan Pokorný2014-09-051-8/+41
| | | | | | | | PluginManager now has an ability to selectively get and initiliaze only selected plugin(s). What remains to be done is a propagation of this principle in the commands - filters - formats chain. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: do not hardcode '.py' (can be derived)Jan Pokorný2014-09-051-4/+5
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: unify passing of look-aside pluginsJan Pokorný2014-09-052-3/+3
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: prefer specific imports from impJan Pokorný2014-09-051-3/+3
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: simplify singular-plural arg handlingJan Pokorný2014-09-051-7/+8
| | | | | | ...using primitives from utils.py Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: s/_init_handle_plugins/_init_pluginsJan Pokorný2014-09-053-11/+13
| | | | | | + add a note that we could somehow initialize plugins earlier Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* utils: consider set a "tuplist" as wellJan Pokorný2014-09-052-2/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* Reconsider plugin (class/symbol) to module organizationJan Pokorný2014-09-0525-62/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation work for being able to pick up plugin of choice nicely without the necessity of scanning the whole name/path space followed with some initialization routines across all plugins even if they won't be used for sure. Such heavy-weight approach is fine for using clufter as CLI tool (covering potentially any available use-case), not so much for the use as a library with presumably a priori determined task to perform. As generally one module can (and often is practical!) contain several modules, we are introducing following convention to allow our proposed filtering to have a good false-positives/convenience ratio: module shall contain only plugins the name of which contains the same prefix as the module's filename does, where the prefix is assumed the part before first occurrence of '_' ('-' for stringified/decorated plugin names) As a concrete example, formats/ccs.py module contains ccs and ccs_flat plugins, hence when ccs_flat is to be picked with this fine granularity and using default search path, only formats/ccs.py file will match the prefix test and hence only ccs and ccs_flat will be prepared for further use (one false positive in this case is a result of the mentioned trade-off). This commit normalizes the plugin-module allocation to follow the convention, reflects these changes in tests, etc. and adds a note to the HACKING doc file. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* Solve a "read-only dict as API" question once foreverJan Pokorný2014-09-0410-135/+173
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: workaround Python pre-2.7 limitation (Issue5982)Jan Pokorný2014-09-041-1/+2
| | | | | | ...making the test suite pass on RHEL 6 once again. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: cosmeticsJan Pokorný2014-09-041-2/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: avoid unneeded indirection (+ potentially other pros)Jan Pokorný2014-09-041-1/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: fix multiple class-level __init__ per one __new__ resultJan Pokorný2014-09-033-12/+25
| | | | | | | + modify tests/run_cmd to trigger such a case Reported-by: Tomáš Jelínek" <tojelinek@redhat.com> Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filter{,_manager}: cosmetics/housekeepingJan Pokorný2014-09-022-8/+8
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filter{,_manager}: filter responsible for resolving selfJan Pokorný2014-09-026-50/+79
| | | | | | ... against the passed formats Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command: more housekeepingJan Pokorný2014-09-021-1/+0
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command: state the only Approved Indenting Convention (TM)Jan Pokorný2014-09-021-6/+27
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command: cosmeticsJan Pokorný2014-09-021-7/+7
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command{,_manager}: command responsible for resolving selfJan Pokorný2014-09-023-89/+101
| | | | | | | | | ... against the passed filters; The convention is that when the Command{,Alias} cannot be resolved successfully, None object is returned from constructing the object. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command_manager: pretty_cmds: sort the commands by nameJan Pokorný2014-09-021-2/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* tests/run_cmd: remove hit-disk test in favor of in-memory oneJan Pokorný2014-09-011-24/+24
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filters/ccs2needlexml: fix malformatted warning messageJan Pokorný2014-09-011-1/+3
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filters/ccs2needlexml: add forgotten outer uidgid elementJan Pokorný2014-09-011-5/+7
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/corosync: uidgid? -> uidgid* in corosync.rngJan Pokorný2014-09-011-2/+2
| | | | | | (Thanks to Tomas Jelinek) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* commands/ccs2pcs: fix another unneeded indirectionJan Pokorný2014-09-011-2/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command: fix extra indirection thinkoJan Pokorný2014-09-011-1/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: syntactic sugar for distilling particular representationJan Pokorný2014-09-012-9/+24
| | | | | | self(self.PROTO, ...) -> self.PROTO(...) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command: make usable as a library (output as a string, etc.)Jan Pokorný2014-09-016-26/+63
| | | | | | New unit test included. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry vs. protocol(s): "kludge" -> fixed featureJan Pokorný2014-09-012-3/+7
| | | | | | | | | | | | | | | | | | In fact, commit 8dd14ec29fe829e9edf0102e45966a4a1cc012d7 commented out what was intentionally present to prevent RuntimeWarning due to importing discovered plugins to the yet non-existent module namespace (missing parent) in case the respective registry hadn't been imported in advance. That commit tried to solve a conflict with protol.py, which referred to "clufter.plugins" module namespace, but unlike the previous registries (formats, filters, commands), "plugins" is not backed by a real module (i.e., neither plugins.py nor plugins/__init__.py exist at the top level). Solution is simple, make protocols registry set the namespace as a non-value, which is then considered a signal not to attempt any such for-the-sake-of-sanity complementary import. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry/commands: implement+use RO view on pluginsJan Pokorný2014-08-294-7/+25
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* commands: reflect symbolic usage of protocolsJan Pokorný2014-08-293-10/+17
| | | | | | (for the time being, test suite left at using direct strings) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* (Optionally) promote protocols to first-class entityJan Pokorný2014-08-297-32/+81
| | | | | | | | | | | | + reflect that on the formats' level (also bring a convention for that) + make plugin_registry.probe fnc more tolerant towards non-classes as we want to differentiate between protocol on instance basis rather than based on dedicated classes (because we want to pragmatically maintain interchangeability with plain strings!) + make extra steps in protocol.py so the mentioned interchangeability actually works Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: prefer specific imports from imp standard moduleJan Pokorný2014-08-291-3/+3
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command_manager: add (dummy) infloop guards for recursive aliasesJan Pokorný2014-08-291-1/+5
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* command_manager: allow for recursive aliases (w/o guards)Jan Pokorný2014-08-292-4/+13
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* plugin_registry: comment out kludge that become harmfull(?)Jan Pokorný2014-08-291-3/+3
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* tests/run_cmd: create test files in tests dirJan Pokorný2014-08-291-4/+6
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* tests/run_cmd: make standalone script (for consistency)Jan Pokorný2014-08-291-0/+4
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* tests/run_cmd: drop (redundant) logging snippetsJan Pokorný2014-08-291-3/+0
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* runtests.sh: ensure the expected PWD when running testsJan Pokorný2014-08-291-1/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>