def handle(self, *args, **options): try: files = get_rdf_files(args, recursive=options["recursive"]) if not files: raise CommandError("You must specify at least one valid RDF file.") fourstore_setup(settings.FOURSTORE_KBNAME) fourstore_backend(settings.FOURSTORE_KBNAME) fourstore_import(settings.FOURSTORE_KBNAME, files) except AttributeError: raise CommandError("You must set FOURSTORE_KBNAME and FOURSTORE_PORT in your settings.py.") except OSError: raise CommandError("Please ensure 4store is installed and accessible in $PATH.") finally: fourstore_kill(settings.FOURSTORE_KBNAME, settings.FOURSTORE_PORT)
def tearDown(self): TestCase.tearDown(self) fourstore_kill(self.kbname, self.port)