Esempio n. 1
0
 def tearDown(self):
     if len(self.backup):
         # wipe existing one completely
         if cfg.has_section("externals"):
             cfg.remove_section("externals")
         cfg.add_section("externals")
         for o, v in self.backup:
             cfg.set("externals", o, v)
     # paranoid check
     # since order can't be guaranteed, lets check
     # each item after sorting
     self.failUnlessEqual(sorted(self.cfgstr.split("\n")), sorted(str(cfg).split("\n")))
Esempio n. 2
0
 def tearDown(self):
     if len(self.backup):
         # wipe existing one completely
         if cfg.has_section('externals'):
             cfg.remove_section('externals')
         cfg.add_section('externals')
         for o,v in self.backup:
             cfg.set('externals', o,v)
     # paranoid check
     # since order can't be guaranteed, lets check
     # each item after sorting
     self.failUnlessEqual(sorted(self.cfgstr.split('\n')),
                          sorted(str(cfg).split('\n')))
Esempio n. 3
0
        if raise_ \
               and cfg.getboolean('externals', 'raise exception', True):
            raise RuntimeError, "Required external '%s' was not found" % dep
        if issueWarning is not None \
               and cfg.getboolean('externals', 'issue warning', True):
            if issueWarning is True:
                warning("Required external '%s' was not found" % dep)
            else:
                warning(issueWarning)


    # store result in config manager
    if not cfg.has_section('externals'):
        cfg.add_section('externals')
    if result:
        cfg.set('externals', 'have ' + dep, 'yes')
    else:
        cfg.set('externals', 'have ' + dep, 'no')

    return result

# Bind functions for some versions checkings
versions._KNOWN.update({
    'numpy' : __assign_numpy_version,
    'scipy' : __assign_scipy_version,
    'nipy' : __assign_nipy_version,
    'matplotlib': __assign_matplotlib_version,
    'mdp' : __assign_mdp_version,
    'ipython' : __check_in_ipython,
    'reportlab' : __check_reportlab,
    'pprocess' : __check_pprocess,
Esempio n. 4
0
    if not result:
        if raise_ \
               and cfg.getboolean('externals', 'raise exception', True):
            raise RuntimeError, "Required external '%s' was not found" % dep
        if issueWarning is not None \
               and cfg.getboolean('externals', 'issue warning', True):
            if issueWarning is True:
                warning("Required external '%s' was not found" % dep)
            else:
                warning(issueWarning)

    # store result in config manager
    if not cfg.has_section('externals'):
        cfg.add_section('externals')
    if result:
        cfg.set('externals', 'have ' + dep, 'yes')
    else:
        cfg.set('externals', 'have ' + dep, 'no')

    return result


# Bind functions for some versions checkings
versions._KNOWN.update({
    'numpy': __assign_numpy_version,
    'scipy': __assign_scipy_version,
    'nipy': __assign_nipy_version,
    'mdp': __assign_mdp_version,
    'ipython': __check_in_ipython,
    'reportlab': __check_reportlab,
    'pprocess': __check_pprocess,