from pp_lib.common import pp
-from pp_lib.app import PpApplication
-
-import pp_lib.format_du
+from pp_lib.format_du import FormatDuApp
log = logging.getLogger(__name__)
__copyright__ = '(C) 2017 by Frank Brehm, Pixelpark GmbH, Berlin'
-app = PpApplication()
+app = FormatDuApp()
#app.initialized = True
if app.verbose > 2:
# Standard modules
import logging
+import textwrap
import six
from .app import PpApplication
-__version__ = '0.1.0'
+try:
+ from .local_version import __version__ as my_version
+except ImportError:
+ from .global_version import __version__ as my_version
+
+__version__ = '0.2.1'
LOG = logging.getLogger(__name__)
+# =============================================================================
+class FormatDuApp(PpApplication):
+ """
+ Application class for the format-du command
+ """
+
+ # -------------------------------------------------------------------------
+ def __init__(
+ self, verbose=0, version=my_version, *arg, **kwargs):
+
+ indent = ' ' * self.usage_term_len
+
+ usage = textwrap.dedent("""\
+ %(prog)s [General options] [Format options] [FILE]
+
+ {i}%(prog)s --usage
+ {i}%(prog)s -h|--help
+ {i}%(prog)s -V|--version
+ """).strip().format(i=indent)
+
+ desc = """Formats the output of 'du -k' for various modifiers."""
+
+ super(FormatDuApp, self).__init__(
+ usage=usage,
+ description=desc,
+ verbose=verbose,
+ version=version,
+ *arg, **kwargs
+ )
+
+ self.post_init()
+ self.initialized = True
+
+ # -------------------------------------------------------------------------
+ def _run(self):
+ """The underlaying startpoint of the application."""
+
+ LOG.info("Starting ...")
+
# =============================================================================