# Standard modules
import logging
+import shutil
# Third party modules
from fb_tools.cfg_app import FbConfigApplication
# Own modules
from .. import __version__ as GLOBAL_VERSION
from .. import DEFAULT_CONFIG_DIR
+from .. import DEFAULT_TERMINAL_WIDTH, DEFAULT_TERMINAL_HEIGHT
from ..xlate import XLATOR
_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.6.1'
+__version__ = '0.6.3'
# =============================================================================
)
# -------------------------------------------------------------------------
- def line(self, width=80, linechar='-', color=None):
+ def line(self, width=None, linechar='-', color=None):
"""Print out an line on stdout, if not in quiet mode."""
if self.quiet:
return
if not lchar:
lchar = '-'
+ if not width:
+ term_size = shutil.get_terminal_size((DEFAULT_TERMINAL_WIDTH, DEFAULT_TERMINAL_HEIGHT))
+ width = term_size.columns
+
lin = (lchar * width)[0:width]
if color:
- lin=self.colored(lin, color)
+ lin = self.colored(lin, color)
print(lin)
# -------------------------------------------------------------------------