Exemple #1
0
    def make_dst_dirs(self):
        if self.dst_folder:
            self.dst_path = os.path.join(self.dst_root, self.dst_folder)
        else:
            self.dst_path = self.dst_root

        rwkos.make_dirs_recrusive(self.dst_path)

        for item in self.relpaths:
            # - if the src is a file, pop the filename
            # - make the dest folders recursively

            #####################
            ##if item.find(filesep) > -1:
            ##    # - do nothing if item doesn't contain a filesep
            #####################
            
            #recursively make folders
            src_path = os.path.join(self.src_root, item)
            cur_dest = os.path.join(self.dst_path, item)
            if os.path.isfile(src_path):
                #this is a file path, pop the file name to get the dir path
                cur_dest, cur_file = os.path.split(cur_dest)
                
            #make the directory structure if it doesn't exist
            if not os.path.exists(cur_dest):
                rwkos.make_dirs_recrusive(cur_dest)
Exemple #2
0
    def make_dst_dirs(self):
        if self.dst_folder:
            self.dst_path = os.path.join(self.dst_root, self.dst_folder)
        else:
            self.dst_path = self.dst_root

        rwkos.make_dirs_recrusive(self.dst_path)

        for item in self.relpaths:
            # - if the src is a file, pop the filename
            # - make the dest folders recursively

            #####################
            ##if item.find(filesep) > -1:
            ##    # - do nothing if item doesn't contain a filesep
            #####################

            #recursively make folders
            src_path = os.path.join(self.src_root, item)
            cur_dest = os.path.join(self.dst_path, item)
            if os.path.isfile(src_path):
                #this is a file path, pop the file name to get the dir path
                cur_dest, cur_file = os.path.split(cur_dest)

            #make the directory structure if it doesn't exist
            if not os.path.exists(cur_dest):
                rwkos.make_dirs_recrusive(cur_dest)
Exemple #3
0
 def __init__(self, path):
     rwkos.make_dirs_recrusive(path)
     self.path = rwkos.FindFullPath(path)
     assert self.path, "Problem with finding/creating path: %s" % path
     rwkos.make_dir(self.path)