_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.9.1'
+__version__ = '0.9.2'
# =============================================================================
msg += ' x = {x:3d}, y = {y:3d}'.format(x=self.x, y=self.y)
return msg
+ # -------------------------------------------------------------------------
+ @property
+ def unknown(self):
+ """Return, whether the cursor position is not evaluated."""
+ if self.x == -1 and self.y == -1:
+ return True
+ return False
+
# =============================================================================
class BaseDPXApplication(FbConfigApplication):
"""Base class for all DPX application classes."""
# show_force_option = False
show_simulate_option = True
- max_term_line_length = 150
-
# -------------------------------------------------------------------------
def __init__(
self, appname=None, verbose=0, version=GLOBAL_VERSION, base_dir=None,
argparse_epilog=None, argparse_prefix_chars='-', env_prefix=None,
config_dir=DEFAULT_CONFIG_DIR):
"""Initialize the BaseDPXApplication object."""
+ self.cur_dots = 0
+
super(BaseDPXApplication, self).__init__(
appname=appname, verbose=verbose, version=version, base_dir=base_dir,
description=description, cfg_class=cfg_class, initialized=False,
return CursorPosition(-1, -1)
+ # -------------------------------------------------------------------------
+ def print_dot(self):
+ """Print out a dot without a newline."""
+ max_x = self.max_term_line_length
+ term_size = shutil.get_terminal_size((DEFAULT_TERMINAL_WIDTH, DEFAULT_TERMINAL_HEIGHT))
+ max_x = term_size.columns
+
+ cur_pos = self.cursor_position()
+ if cur_pos.unknown:
+ cur_pos = self.cur_dots + 1
+
+ if cur_pos >= max_x:
+ print()
+ self.cur_dots = 0
+
+ print('.', end='', flush=True)
+ self.cur_dots += 1
+
# =============================================================================