<s> from ztag . annotation import * <EOL> import re <EOL> class CherokeeServer ( Annotation ) : <EOL> protocol = protocols . HTTP <EOL> subprotocol = protocols . HTTP . GET <EOL> port = None <EOL> version_re = re . compile ( '<STR_LIT>' ) <EOL> os_re = re . compile ( '<STR_LIT>' ) <EOL> def process ( self , obj , meta ) : <EOL> server = obj [ "<STR_LIT>" ] [ "<STR_LIT>" ] <EOL> if "<STR_LIT>" in server . lower ( ) : <EOL> meta . local_metadata . manufacturer = Manufacturer . CHEROKEE <EOL> meta . local_metadata . product = "<STR_LIT>" <EOL> version = self . version_re . search ( server ) <EOL> if version and version . group ( <NUM_LIT:1> ) : <EOL> meta . local_metadata . version = version <EOL> os = self . os_re . search ( server ) <EOL> if os and os . group ( <NUM_LIT:1> ) : <EOL> if "<STR_LIT:/>" in os : <EOL> os = os . split ( "<STR_LIT:/>" ) [ <NUM_LIT:0> ] <EOL> meta . global_metadata . os = os <EOL> return meta </s>
