Make a directory shareable.
343119
def add(**kwargs):
  '''  '''

  output, err = cli_syncthing_adapter.add(**kwargs)
  click.echo("%s" % output, err=err)
1132409
def push(self, dir):
        
        self.stack.append(os.getcwd())
        os.chdir(dir or os.getcwd())
84437
def addJsonDirectory(self, directory, test=None):
    """"""

    for filename in os.listdir(directory):
      try:
        fullPath = os.path.join(directory, filename)
        if not test or test(filename, fullPath):
          with open(fullPath) as f:
            jsonData = json.load(f)
            name, _ = os.path.splitext(filename)
            self.addSource(name, jsonData)

      except ValueError:
        continue
48767
def create_dir_unless_exists(*args):
    """"""
    path = os.path.join(*args)
    if not os.path.isdir(path):
        os.makedirs(path)
840885
def MakeDir(self, path="temp"):
        
        full_path = _os.path.join(self.path_home, path)

        # only make it if it doesn't exist!
        if not _os.path.exists(full_path): _os.makedirs(full_path)
92013
def _safe_mkdir(directory):
    """"""
    try:
        os.makedirs(directory)
    except OSError as error:
        if error.errno != errno.EEXIST:
            raise error
630371
def make_folder(path):
    
    if not os.path.exists(path):
        try:
            os.makedirs(path)
        except OSError as exception:
            if exception.errno != errno.EEXIST:
                raise ValueError('Specified folder is not writable: %s'
                                 '\nPlease check permissions or set a new valid folder.' % path)
258640
def _create(self):
        """"""

        self._raise_if_none()
        if not self._exists:
            mkdir_p(self.path)
            self._exists = True
1042261
def create_directory(self, filename):
        """"""
        path = os.path.join(self.path, filename)
        makedirs(path)
        return path
1105976
def initialize_directories(self):
        """"""
        makedirs(self.config.source_index)
        makedirs(self.config.eggs_cache)
119839
def ensure_readable(self):
        """"""
        self.ensure_exists()
        if not self.context.is_readable(self.directory):
            if self.context.have_superuser_privileges:
                msg = "The directory %s isn't readable!"
                raise ValueError(msg % self)
            else:
                raise ValueError(compact("""
                    The directory {location} isn't readable, most likely
                    because of permissions. Consider using the --use-sudo
                    option.
                """, location=self))
726206
def make_directory(self, directory_name, *args, **kwargs):
		
		previous_path = self.session_path()
		try:
			self.session_path(directory_name)
			os.mkdir(self.full_path())
		finally:
			self.session_path(previous_path)
1237638
def make_directory(directory):
    
    if not os.path.isdir(directory):
        os.mkdir(directory)
        logger.info('Path {} not found, I will create it.'
                    .format(directory))
505945
def ensure_dirs(filename):
    """"""
    dirname, _ = os.path.split(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
521304
def _mkdirs_impacket(path, share='C$', conn=None, host=None, username=None, password=None):
    '''
    
    '''
    if conn is None:
        conn = get_conn(host, username, password)

    if conn is False:
        return False

    comps = path.split('/')
    pos = 1
    for comp in comps:
        cwd = '\\'.join(comps[0:pos])
        try:
            conn.listPath(share, cwd)
        except (smbSessionError, smb3SessionError):
            log.exception('Encountered error running conn.listPath')
            conn.createDirectory(share, cwd)
        pos += 1
412395
def create_cached_data_dir():
    '''
    
    '''
    writable_directory = os.path.join(os.path.expanduser('~'), '.local', 'share')
    data_directory = os.path.join(os.environ.get("XDG_DATA_HOME", writable_directory),
                                  'compliance-checker')
    if not os.path.isdir(data_directory):
        os.makedirs(data_directory)

    return data_directory
455927
def can_share_folder(self, user, folder):
        
        return folder.parent_id is None and folder.author_id == user.id