Save the store to disk

def to_file(self, filename):
        """ Save the store to disk """

        # save compressed file
        xml = self.to_xml()
        f = gzip.open(filename, 'wb')
        try:
            f.write(xml.encode('utf-8'))
        finally:
            f.close()