def setup(app): # pragma: no cover cwd = os.getcwd() # From Sphinx, we typing "make html", this is the place where we expect # the JS to be found staticpath = os.sep.join([cwd, "source", "_static"]) from easydev.tools import mkdirs mkdirs(staticpath) if os.path.exists(staticpath + os.sep + "copybutton.js"): pass # the JS file is already there. else: # Not found, so let us copy it import shutil shutil.copy(get_copybutton_path(), staticpath) # Now that the file is available, use it app.add_js_file('copybutton.js')
def test_mkdirs(): import tempfile, os tools.mkdirs(tempfile.mkdtemp() + os.sep + "test") try: tools.mkdirs(tempfile.mkdtemp() + os.sep + "test") assert False except: assert True # without / , was not working but is now part of the API tools.mkdirs(tempfile.mkdtemp())
def _mkdirs(self, newdir, mode=0o777): """See :func:`easydev.tools.mkdirs`""" from easydev.tools import mkdirs mkdirs(newdir, mode)