<s> from vt_manager . communication . sfa . rspecs . elements . element import Element <EOL> from vt_manager . communication . sfa . rspecs . elements . fw_rule import FWRule <EOL> class PLOSv1FWRule : <EOL> @ staticmethod <EOL> def add_rules ( xml , rules ) : <EOL> if not rules : <EOL> return <EOL> for rule in rules : <EOL> rule_elem = xml . add_element ( '<STR_LIT>' % xml . namespaces [ '<STR_LIT>' ] ) <EOL> rule_elem . set ( '<STR_LIT>' , rule . get ( '<STR_LIT>' ) ) <EOL> rule_elem . set ( '<STR_LIT>' , rule . get ( '<STR_LIT>' ) ) <EOL> rule_elem . set ( '<STR_LIT>' , rule . get ( '<STR_LIT>' ) ) <EOL> if rule . get ( '<STR_LIT>' ) : <EOL> rule_elem . set ( '<STR_LIT>' , rule . get ( '<STR_LIT>' ) ) <EOL> @ staticmethod <EOL> def get_rules ( xml ) : <EOL> rules = [ ] <EOL> if '<STR_LIT>' in xml . namespaces : <EOL> for rule_elem in xml . xpath ( '<STR_LIT>' ) : <EOL> rule = FWRule ( rule_elem . attrib , rule_elem ) <EOL> rules . append ( rule ) <EOL> return rules </s>
