def setup_class(cls): cls.kata_plugin = KataPlugin()
def setup_class(cls): """Set up tests.""" cls.kata_plugin = KataPlugin()
package_dict['id'] = pkg.id log.debug('Found existing package with PIDs: {pid}'.format( pid=package_dict['pids'])) errors = self.ddi_converter.get_errors() if errors: # FIXME: Using line number here hazardous. Old _read_value doesn't support for er, line in errors: self._save_object_error( 'Invalid or missing mandatory metadata in {ur}. ' '{er}'.format(ur=info['url'], er=er), harvest_object, 'Import', line) self.ddi_converter.empty_errors() if not package_dict: return False schema = KataPlugin.create_package_schema_ddi() result = self._create_or_update_package(package_dict, harvest_object, schema) log.debug("Exiting import_stage()") return result # returns True def fetch_xml(self, url, context): '''Get xml for import. Shortened from :meth:`fetch_stage` :param url: the url for metadata file :param type: string :return: a xml file :rtype: string ''' try:
log.debug("Found existing package with PIDs: {pid}".format(pid=package_dict["pids"])) errors = self.ddi_converter.get_errors() if errors: # FIXME: Using line number here hazardous. Old _read_value doesn't support for er, line in errors: self._save_object_error( "Invalid or missing mandatory metadata in {ur}. " "{er}".format(ur=info["url"], er=er), harvest_object, "Import", line, ) self.ddi_converter.empty_errors() if not package_dict: return False schema = KataPlugin.create_package_schema_ddi() result = self._create_or_update_package(package_dict, harvest_object, schema) self.ddi_converter.write_fsd_ref() log.debug("Exiting import_stage()") return result # returns True def fetch_xml(self, url, context): """Get xml for import. Shortened from :meth:`fetch_stage` :param url: the url for metadata file :param type: string :return: a xml file :rtype: string """ try:
def get_schema(self, config, pkg): from ckanext.kata.plugin import KataPlugin return KataPlugin.create_package_schema_oai_cmdi()
def get_schema(self): from ckanext.kata.plugin import KataPlugin return KataPlugin.create_package_schema_oai_datacite()