Add a directory and optionally its path.
487229
def add(self, directory, path=None) -> None:
        """"""
        objecttools.valid_variable_identifier(directory)
        if path is None:
            path = directory
        setattr(self, directory, path)
1042261
def create_directory(self, filename):
        """"""
        path = os.path.join(self.path, filename)
        makedirs(path)
        return path
1240893
def directory(self, value):
        """"""
        # Normalize the value of `directory'.
        set_property(self, "directory", parse_path(value))
        # Clear the computed values of `context' and `entries'.
        clear_property(self, "context")
        clear_property(self, "entries")
1049340
def setup_dir(f):
    ''' 
    '''
    setup_dir = os.path.dirname(os.path.abspath(__file__))

    def wrapped(*args, **kwargs):
        with chdir(setup_dir):
            return f(*args, **kwargs)

    return wrapped
1191114
def add(self, path):
        '''
        
        '''
        with salt.utils.files.fopen(path, 'rb') as ifile:
            for chunk in iter(lambda: ifile.read(self.__buff), b''):
                self.__digest.update(chunk)
496381
def create_path(path):
    
    import os
    if not os.path.exists(path):
        os.makedirs(path)
1109939
def ensure_dir(filename):
    """"""
    directory = os.path.dirname(filename)
    if directory and not os.path.isdir(directory):
        os.makedirs(directory)
578941
def expand(directory: str) -> str:
    """"""
    temp1 = os.path.expanduser(directory)
    return os.path.expandvars(temp1)
848218
def mk_dir(self) :
        """"""
        if not os.path.exists(self.abs) :
            os.makedirs(self.abs)
1218637
def include_dir(self, root):
        """"""
        parts = [root]
        parts.extend(self.pathname.split(os.path.sep))
        return "/".join(parts)
231337
def create_directory(self, path=None):
        
        if path is None:
            path = self.get_path()
        if not os.path.exists(path):
            os.makedirs(path)
1261143
def PathIsDir(self, key, val, env):
        """"""
        if not os.path.isdir(val):
            if os.path.isfile(val):
                m = 'Directory path for option %s is a file: %s'
            else:
                m = 'Directory path for option %s does not exist: %s'
            raise SCons.Errors.UserError(m % (key, val))
1092172
def makedirs(path):
    """"""
    path = Path(path)

    if not path.exists():
        path.mkdir(parents=True)
1001732
def mkdir(dir, enter):
    

    if not os.path.exists(dir):
        os.makedirs(dir)
519956
def add_directory(self, directory: PathLike) -> None:
        
        directory = os.path.abspath(directory)
        if not os.path.isdir(directory):
            raise IOError("not a directory: {!r}".format(directory))

        for tbfile in fnmatch.filter(os.listdir(directory), "*.gtb.cp4"):
            self.available_tables[os.path.basename(tbfile).replace(".gtb.cp4", "")] = os.path.join(directory, tbfile)
1152996
def mkdir(dir_path):
        # type: (AnyStr) -> None
        """"""
        if not os.path.isdir(dir_path) or not os.path.exists(dir_path):
            os.makedirs(dir_path)
303568
def ensure_dir(path):
    
    os.makedirs(os.path.abspath(os.path.dirname(path)), exist_ok=True)