From a09d4139d50cdac365b56fe1904191870d3dfdf4 Mon Sep 17 00:00:00 2001 From: Michael Krane Date: Thu, 28 Apr 2016 19:06:53 +0200 Subject: [PATCH] Removes everything before and after the DNA --- service/port.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/service/port.py b/service/port.py index 4eb570f1d..d330515c8 100644 --- a/service/port.py +++ b/service/port.py @@ -206,7 +206,17 @@ class Port(object): @staticmethod def importDna(string): sMkt = service.Market.getInstance() - string = string.replace("javascript:CCPEVE.showFitting('", "").replace("');", "") + + ids = map(int, re.findall(r'\d+', string)) + for id in ids: + try: + Ship(sMkt.getItem(id)) + string = string[string.index(str(id)):] + break + except Exception, e: + continue + pass + string = string[0: (string.index("::") + 2)] info = string.split(":") f = Fit()