From f18ba6160aa4956b18615373f2942e613e6a269a Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Sat, 8 Aug 2015 13:36:16 +0300 Subject: [PATCH] Do 2 blank lines between cargo contents and the rest of the fit, and when exported with the implants - do cargo items after the implants --- service/port.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/service/port.py b/service/port.py index e9a88ab3b..23721945f 100644 --- a/service/port.py +++ b/service/port.py @@ -425,7 +425,7 @@ class Port(object): return fits @staticmethod - def exportEft(fit): + def _exportEftBase(fit): offineSuffix = " /OFFLINE" export = "[%s, %s]\n" % (fit.ship.item.name, fit.name) stuff = {} @@ -452,24 +452,40 @@ class Port(object): export += "\n\n" for drone in fit.drones: export += "%s x%s\n" % (drone.item.name, drone.amount) - if len(fit.cargo) > 0: - for cargo in fit.cargo: - export += "%s x%s\n" % (cargo.item.name, cargo.amount) if export[-1] == "\n": export = export[:-1] return export + @classmethod + def exportEft(cls, fit): + export = cls._exportEftBase(fit) + + if len(fit.cargo) > 0: + export += "\n\n\n" + for cargo in fit.cargo: + export += "%s x%s\n" % (cargo.item.name, cargo.amount) + if export[-1] == "\n": + export = export[:-1] + + return export + @classmethod def exportEftImps(cls, fit): - export = cls.exportEft(fit) + export = cls._exportEftBase(fit) if len(fit.implants) > 0: export += "\n\n\n" for implant in fit.implants: export += "%s\n" % implant.item.name + if export[-1] == "\n": + export = export[:-1] + if len(fit.cargo) > 0: + export += "\n\n\n" + for cargo in fit.cargo: + export += "%s x%s\n" % (cargo.item.name, cargo.amount) if export[-1] == "\n": export = export[:-1]