Python distutils.dir_util.mkpath() Examples

The following are 30 code examples of distutils.dir_util.mkpath(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module distutils.dir_util , or try the search function .
Example #1
Source File: setup.py    From mysql-utilities with GNU General Public License v2.0 6 votes vote down vote up
def run(self):
        """Run the command"""
        srcdir = os.path.join('docs', 'man')
        manpages = os.listdir(srcdir)
        self._outfiles = []
        for man in manpages:
            src_man = os.path.join(srcdir, man)
            section = os.path.splitext(man)[1][1:]
            dest_dir = os.path.join(self.prefix, 'man' + section)
            self.mkpath(dest_dir)  # Could be different section
            dest_man = os.path.join(dest_dir, man)
            self.copy_file(src_man, dest_man)
            self._outfiles.append(dest_man)

        # Disabled, done in the RPM spec
        # self._write_record() 
Example #2
Source File: cmd.py    From RevitBatchProcessor with GNU General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #3
Source File: ccompiler.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        mkpath(name, mode, dry_run=self.dry_run)


# class CCompiler


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #4
Source File: deploy_stack.py    From nova with MIT License 5 votes vote down vote up
def __build_upload_revision(self, deployment_bucket_name, key):
        print(colored("No existing revision found, creating...", color='magenta'))
        print(colored("Generating deployment scripts in '%s'..." % self._nova_deploy_dir, color='cyan'))
        self.__create_nova_deploy_dirs()
        self.__create_app_spec()
        # Find docker image and 'save' it to {nova_deploy_dir}/docker/image-{build-id}.tar.gz
        looking_for_tag = "%s:%s" % (self._service_manager.service_name, self._build_id)
        out_file = "%s/docker/%s-%s-docker-image.tar.gz" % (
            self._nova_deploy_dir, self._service_manager.service_name, self._build_id)
        dir_util.mkpath("%s/docker" % self._nova_deploy_dir)
        docker_image = self._docker_manager.save_docker_image_with_tag(looking_for_tag, out_file)
        self.__generate_scripts(docker_image)
        revision_etag = self._aws_manager.push_revision(deployment_bucket_name, key, self._code_deploy_app, self._nova_deploy_dir)
        shutil.rmtree(self._nova_deploy_dir)
        return revision_etag 
Example #5
Source File: ccompiler.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        mkpath(name, mode, dry_run=self.dry_run)


# class CCompiler


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #6
Source File: ccompiler.py    From PokemonGo-DesktopMap with MIT License 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        mkpath(name, mode, dry_run=self.dry_run)


# class CCompiler


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #7
Source File: cmd.py    From unity-python with MIT License 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #8
Source File: cmd.py    From unity-python with MIT License 5 votes vote down vote up
def _copy_files(self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #9
Source File: ccompiler.py    From unity-python with MIT License 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        mkpath(name, mode, dry_run=self.dry_run)


# class CCompiler


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #10
Source File: cmd.py    From android_universal with MIT License 5 votes vote down vote up
def mkpath(self, name, mode=0o777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #11
Source File: ccompiler.py    From android_universal with MIT License 5 votes vote down vote up
def mkpath (self, name, mode=0o777):
        mkpath(name, mode, dry_run=self.dry_run)


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #12
Source File: cmd.py    From canape with GNU General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #13
Source File: cmd.py    From canape with GNU General Public License v3.0 5 votes vote down vote up
def _copy_files(self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #14
Source File: cmd.py    From PokemonGo-DesktopMap with MIT License 5 votes vote down vote up
def _copy_files(self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #15
Source File: cmd.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def _copy_files(self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #16
Source File: cmd.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #17
Source File: ccompiler.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def mkpath (self, name, mode=0777):
        mkpath (name, mode, self.dry_run)


# class CCompiler


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #18
Source File: cmd.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def _copy_files (self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #19
Source File: cmd.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def mkpath (self, name, mode=0777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #20
Source File: ccompiler.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def mkpath (self, name, mode=0o777):
        mkpath(name, mode, dry_run=self.dry_run)


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #21
Source File: cmd.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def _copy_files(self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #22
Source File: cmd.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0o777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #23
Source File: ccompiler.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        mkpath(name, mode, dry_run=self.dry_run)


# class CCompiler


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #24
Source File: cmd.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def _copy_files(self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #25
Source File: cmd.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #26
Source File: ccompiler.py    From setuptools with MIT License 5 votes vote down vote up
def mkpath (self, name, mode=0o777):
        mkpath(name, mode, dry_run=self.dry_run)


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names. 
Example #27
Source File: cmd.py    From setuptools with MIT License 5 votes vote down vote up
def mkpath(self, name, mode=0o777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run) 
Example #28
Source File: utils.py    From comet-commonsense with Apache License 2.0 5 votes vote down vote up
def make_name(opt, prefix="", eval_=False, is_dir=True, set_epoch=None,
              do_epoch=True):
    string = prefix
    string += "{}-{}".format(opt.dataset, opt.exp)
    string += "/"
    string += "{}-{}-{}".format(opt.trainer, opt.cycle, opt.iters)
    string += "/"
    string += opt.model
    if opt.mle:
        string += "-{}".format(opt.mle)
    string += "/"
    string += make_name_string(opt.data) + "/"

    string += make_name_string(opt.net) + "/"
    string += make_name_string(opt.train.static) + "/"

    if eval_:
        string += make_name_string(opt.eval) + "/"
    # mkpath caches whether a directory has been created
    # In IPython, this can be a problem if the kernel is
    # not reset after a dir is deleted. Trying to recreate
    # that dir will be a problem because mkpath will think
    # the directory already exists
    if not is_dir:
        mkpath(string)
    string += make_name_string(
        opt.train.dynamic, True, do_epoch, set_epoch)
    if is_dir:
        mkpath(string)

    return string 
Example #29
Source File: cmd.py    From datafari with Apache License 2.0 5 votes vote down vote up
def _copy_files(self, filelist):
        self.outfiles = []
        if not filelist:
            return
        self.mkpath(self.install_dir)
        for f in filelist:
            self.copy_file(f, self.install_dir)
            self.outfiles.append(os.path.join(self.install_dir, f)) 
Example #30
Source File: cmd.py    From datafari with Apache License 2.0 5 votes vote down vote up
def mkpath(self, name, mode=0777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run)