tow/sunburnt — pull request #82 by foobacca (2014-02-11 17:51:48+00:00)
Title: Use schema spread across multiple files using xinclude

It is valid for Solr to use a schema spread across multiple files using
xinclude: https://wiki.apache.org/solr/SolrConfigXml#XInclude

lxml supports assembling them via the xinclude() method. However it
can only do that on a set of files on the local filesystem.

With this commit, sunburnt will parse the schema.xml and see if there
are any xinclude elements in it. If there are it will fetch the
required files via the Solr admin, save them all locally and use them.

Before this commit, the SolrInterface class would fetch the file and
pass it to the SolrSchema class where the parsing would be done. But we
now have a loop where we parse a file we've fetched, and depending on
the results of the parse we might have to fetch more files. So this
commit means we have to mix those two steps in a single class -
SolrInterface.

To keep the external interface to SolrSchema backwards compatible it can
take either a file like object which it will parse, or a tree object
that it will use directly. Bit of a hack I know.