2019-01-27 20:28:58 +00:00
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
|
|
|
|
|
|
class AbstractParser(ABC):
|
2019-01-31 18:19:44 +00:00
|
|
|
'''The class describes fields parsing mechanisms'''
|
2019-01-27 20:28:58 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
@abstractmethod
|
|
|
|
def parse_address_field(self, field):
|
2019-01-31 18:19:44 +00:00
|
|
|
'''In address field can be plased any text, describing address of
|
|
|
|
scanning target'''
|
2019-01-27 20:28:58 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
@abstractmethod
|
|
|
|
def parse_port_field(self, field):
|
2019-01-31 18:19:44 +00:00
|
|
|
'''In port field only numbers, whitespaces, comma and '-' allowed'''
|
2019-01-27 20:28:58 +00:00
|
|
|
pass
|