From c619efa68e4ea211b73bdad1e2a2e89fe1c5de26 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Tue, 20 Nov 2018 13:03:27 +0300 Subject: [PATCH] Change the way DNA import is handled --- service/port/port.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/service/port/port.py b/service/port/port.py index a544cecf4..e82e3630b 100644 --- a/service/port/port.py +++ b/service/port/port.py @@ -231,11 +231,16 @@ class Port(object): if re.match("\[.*,.*\]", firstLine): return "EFT", (cls.importEft(string),) + # Check if string is in DNA format + if re.match("\d+(:\d+(;\d+))*::", firstLine): + return "DNA", (cls.importDna(string),) + + # Assume that we import stand-alone abyssal module if all else fails try: return "Abyssal", (parseMutant(string.split("\n")),) except: - # Use DNA format for all other cases - return "DNA", (cls.importDna(string),) + pass + # EFT-related methods @staticmethod