]> Frank Brehm's Git Trees - pixelpark/puppet-tools.git/commitdiff
Adding parameters to line() and ampty_line() methods.
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 14 Feb 2023 09:54:55 +0000 (10:54 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 14 Feb 2023 09:54:55 +0000 (10:54 +0100)
lib/dpx_puppettools/app/__init__.py

index 04ba703bf84caf1ac29c70717769670cf999566d..188c649d31d790e110209a0bba383bbffdf8b3dc 100644 (file)
@@ -45,7 +45,7 @@ LOG = logging.getLogger(__name__)
 _ = XLATOR.gettext
 ngettext = XLATOR.ngettext
 
-__version__ = '0.3.0'
+__version__ = '0.3.1'
 
 
 # =============================================================================
@@ -91,7 +91,7 @@ class BaseDPXPuppetApplication(FbConfigApplication):
         )
 
     # -------------------------------------------------------------------------
-    def line(self, width=None, linechar='-', color=None):
+    def line(self, width=None, linechar='-', color=None, end='\n', file=None, flush=False):
         """Print out an line on stdout, if not in quiet mode."""
         if self.quiet:
             return
@@ -107,13 +107,13 @@ class BaseDPXPuppetApplication(FbConfigApplication):
         lin = (lchar * width)[0:width]
         if color:
             lin = self.colored(lin, color)
-        print(lin)
+        print(lin, end=end, file=file, flush=flush)
 
     # -------------------------------------------------------------------------
-    def empty_line(self):
+    def empty_line(self, file=None, flush=False):
         """Print out an empty line on stdout, if not in quiet mode."""
         if not self.quiet:
-            print()
+            print('', file=file, flush=flush)
 
     # -------------------------------------------------------------------------
     def post_init(self):