def get_prefixes(self, query):
try:<EOL><INDENT>res = Prefix.smart_search(query, {})<EOL><DEDENT>except socket.error:<EOL><INDENT>print >> sys.stderr, "<STR_LIT>"<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>except xmlrpclib.ProtocolError:<EOL><INDENT>print >> sys.stderr, "<STR_LIT>"<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>for p in res['<STR_LIT:result>']:<EOL><INDENT>p.prefix_ipy = IPy.IP(p.prefix)<EOL>self.prefixes.append(p)<EOL><DEDENT>
Get prefix data from NIPAP