Example #1
0
def check_for_dtd_error(args):
    a = Article(archive_file=args.article_file.name, read_only=True)
    error = a.check_for_dtd_error()
    if error:
        if args.format_ariespull:
            print "error: DTD error: %s" % error
        else:
            print error
    a.close()
Example #2
0
def consume_si(args):
    a = Article(archive_file=args.article_file.name)
    if args.si_package:
        si = MetadataPackage(archive_file=args.si_package.name)
    else:
        logger.debug("No metadata package provided in call, trying to find one in AI ...")
        si_package = find_si_package(a.doi) #TODO: add manual directory input
        if not si_package:
            a.close()
            raise IOError("Can't find metadata package for %s" %
                          a.doi)
        try:
            si = MetadataPackage(archive_file=si_package)
        except IOError, e:
            a.close()
            raise IOError("Can't find metadata package for %s at %s" %
                          (a.doi, si_package))