diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-09-04 23:28:06 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-09-05 18:44:46 +0200 |
commit | 5ed999651ec89bfbc1ab1e8283b40ae2476a02da (patch) | |
tree | 2004538be054b1556674421098b45dd1bf1f3715 /formats | |
parent | 749603e2faa6f44c26883cac83c41faad6b81fd4 (diff) | |
download | clufter-5ed999651ec89bfbc1ab1e8283b40ae2476a02da.tar.gz clufter-5ed999651ec89bfbc1ab1e8283b40ae2476a02da.tar.xz clufter-5ed999651ec89bfbc1ab1e8283b40ae2476a02da.zip |
Reconsider plugin (class/symbol) to module organization
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>
Diffstat (limited to 'formats')
-rw-r--r-- | formats/ccs.py | 2 | ||||
-rw-r--r-- | formats/coroxml.py (renamed from formats/coro.py) | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/formats/ccs.py b/formats/ccs.py index 6f0dff1..e71af0c 100644 --- a/formats/ccs.py +++ b/formats/ccs.py @@ -20,7 +20,7 @@ class ccs(XML): } -class flatccs(ccs): +class ccs_flat(ccs): """Private, artificially flattened CMAN-based cluster stack configuration Sometimes (ehm, exclusively by me) called Cluster Configuration System Flat. diff --git a/formats/coro.py b/formats/coroxml.py index 492da00..142f388 100644 --- a/formats/coro.py +++ b/formats/coroxml.py @@ -1,8 +1,8 @@ # -*- coding: UTF-8 -*- -# Copyright 2013 Red Hat, Inc. +# Copyright 2014 Red Hat, Inc. # Part of clufter project # Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt) -"""Corosync executive configuration""" +"""Corosync executive configuration, XML representations""" __author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>" from ..format import XML |