From fa5b47439602b4b524873cd539ad3bd235529a65 Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Thu, 31 Aug 2017 13:44:28 +0100 Subject: [PATCH] Don't print pending War, War when two factions closest in influence are pending War. --- plugin/faction/faction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/faction/faction.py b/plugin/faction/faction.py index b3f6757..b99d4b1 100644 --- a/plugin/faction/faction.py +++ b/plugin/faction/faction.py @@ -1144,7 +1144,7 @@ class Faction(DBConnection): return True def null_report(self): - return { 'faction_id': 0, 'text': '', 'state': '', 'pending': [], 'recovering': [] } + return { 'faction_id': 0, 'text': '', 'state': '', 'pending': set(), 'recovering': set() } def format_trend(self, state_id, trend): return '{}{}'.format('+' * trend if trend > 0 else '-' * abs(trend), eddb.state_name(state_id)) @@ -1217,7 +1217,7 @@ class Faction(DBConnection): report['state'] = eddb.state_name(row['state_id']) if row['trend'] is not None: key = 'pending' if bot.parse_boolean(row['pending']) else 'recovering' - report[key].append(self.format_trend(row['pending_state_id'], row['trend'])) + report[key].add(self.format_trend(row['pending_state_id'], row['trend'])) line = self.format_report(report, id = id) if line is not None: -- 2.7.4