Skip to content

Commit

Permalink
For those long multiline modular summary tags, tranform them into
Browse files Browse the repository at this point in the history
one-liners before showing in 'module list'. So, we prevent showing
extra '\x0a'('\n') in result table
  • Loading branch information
plageat authored and pkratoch committed Mar 18, 2021
1 parent 4763920 commit ed06bbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dnf/module/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@ def _profile_report_formatter(self, modulePackage, default_profiles, enabled_str
else ", "
return profiles_str[:-2]

def _summary_report_formatter(self, summary):
return summary.strip().replace("\n", " ")

def _module_strs_formatter(self, modulePackage, markActive=False):
default_str = ""
enabled_str = ""
Expand Down Expand Up @@ -761,7 +764,8 @@ def _create_and_fill_table(self, latest):
column_stream).setData(
modulePackage.getStream() + default_str + enabled_str + disabled_str)
line.getColumnCell(column_profiles).setData(profiles_str)
line.getColumnCell(column_info).setData(modulePackage.getSummary())
summary_str = self._summary_report_formatter(modulePackage.getSummary())
line.getColumnCell(column_info).setData(summary_str)

return table

Expand Down

0 comments on commit ed06bbf

Please sign in to comment.