def setUp(self):
        """Initialize stuff"""
        #self.tmpdir = invenio.config.CFG_TMPDIR
        config.CFG_TMPDIR = tempfile.gettempdir()

        self.oldstdout = sys.stdout
        self.oldstderr = sys.stderr
        self.stdout = None
        self.stderr = None

        self.taxonomy_name = "test"

        self.log_level = bconfig.logging_level
        bconfig.set_global_level(bconfig.logging.CRITICAL)
Exemple #2
0
    def setUp(self):
        """Initialize stuff"""
        #self.tmpdir = invenio.config.CFG_TMPDIR
        config.CFG_TMPDIR = tempfile.gettempdir()

        self.oldstdout = sys.stdout
        self.oldstderr = sys.stderr
        self.stdout = None
        self.stderr = None

        self.taxonomy_name = "test"

        self.log_level = bconfig.logging_level
        bconfig.set_global_level(bconfig.logging.CRITICAL)
 def tearDown(self):
     if self.stdout:
         self.unredirect()
     bconfig.set_global_level(self.log_level)
        "--check-taxonomy": "check_taxonomy",
        "--detect-author-keywords": "with_author_keywords",
        "-d": "with_author_keywords",
        "--extract-acronyms": "extract_acronyms",
        "-e": "extract_acronyms",
        "--only-core-tags": "only_core_tags",
    }

    for option, argument in opts:
        if option in ("-h", "--help"):
            _display_help()
        elif option in ("-V", "--version"):
            _display_version()
        elif option in ("-v", "--verbose"):
            log.setLevel(int(argument))
            bconfig.set_global_level(int(argument))
        elif option in ("-f", "--file"):
            options["text_files"].append(argument)
        elif option in with_argument:
            options[with_argument[option]] = argument
        elif option in without_argument:
            options[without_argument[option]] = True
        else:
            # This shouldn't happen as gnu_getopt should already handle
            # that case.
            log.error("option unrecognized -- %s" % option)


    # Collect the text inputs.
    options["text_files"] = args
Exemple #5
0
 def tearDown(self):
     if self.stdout:
         self.unredirect()
     bconfig.set_global_level(self.log_level)
Exemple #6
0
        "--check-taxonomy": "check_taxonomy",
        "--detect-author-keywords": "with_author_keywords",
        "-d": "with_author_keywords",
        "--extract-acronyms": "extract_acronyms",
        "-e": "extract_acronyms",
        "--only-core-tags": "only_core_tags",
    }

    for option, argument in opts:
        if option in ("-h", "--help"):
            _display_help()
        elif option in ("-V", "--version"):
            _display_version()
        elif option in ("-v", "--verbose"):
            log.setLevel(int(argument))
            bconfig.set_global_level(int(argument))
        elif option in ("-f", "--file"):
            options["text_files"].append(argument)
        elif option in with_argument:
            options[with_argument[option]] = argument
        elif option in without_argument:
            options[without_argument[option]] = True
        else:
            # This shouldn't happen as gnu_getopt should already handle
            # that case.
            log.error("option unrecognized -- %s" % option)

    # Collect the text inputs.
    options["text_files"] = args

    # Test if the options are consistent.