diff --git a/screenless/bureau/bureau.py b/screenless/bureau/bureau.py index 0f19da5..266a54a 100644 --- a/screenless/bureau/bureau.py +++ b/screenless/bureau/bureau.py @@ -98,7 +98,8 @@ class LogPrinter(logging.Handler): prn.set() msg = self.format(record) #text = textwrap.fill(msg, width=self.printer["textwidth"]) - splitter_regex = r'.{1,' + str(self.printer["textwidth"]) + '}(?:\s+|$)' + cols = self.printer["profile"].get_columns("a") + splitter_regex = r'.{1,' + str(cols) + '}(?:\s+|$)' out_text = "\r\n".join(line.strip() for line in re.findall(splitter_regex, msg)) out_text += "\r\n" * 4 @@ -468,8 +469,8 @@ class Bureau(object): """ prn = self._get_small_printer() prn.set() - - splitter_regex = r'.{1,' + str(self.smprint["textwidth"]) + '}(?:\s+|$)' + cols = self.smprint["profile"].get_columns("a") + splitter_regex = r'.{1,' + str(cols) + '}(?:\s+|$)' out_text = "\r\n".join(line.strip() for line in re.findall(splitter_regex, text))