<s> import re <EOL> from . abstract import AbstractRegexLinkResolver <EOL> PATTERN_SETTING = '<STR_LIT>' <EOL> PATTERN_DEFAULT = r'<STR_LIT>' <EOL> URL_SETTING = '<STR_LIT>' <EOL> URL_DEFAULT = '<STR_LIT>' <EOL> class Resolver ( AbstractRegexLinkResolver ) : <EOL> def __init__ ( self , view ) : <EOL> super ( Resolver , self ) . __init__ ( view ) <EOL> get = self . settings . get <EOL> pattern = get ( PATTERN_SETTING , PATTERN_DEFAULT ) <EOL> self . regex = re . compile ( pattern ) <EOL> self . url = get ( URL_SETTING , URL_DEFAULT ) <EOL> def replace ( self , match ) : <EOL> return self . url % match . group ( '<STR_LIT>' ) </s>
