Get the path to custom channels

    Returns:
        The path for custom channels.
172568
def get_custom_modules_path() -> Path:
    
    channel_path = get_base_path() / "modules"
    if not channel_path.exists():
        channel_path.mkdir(parents=True)
    return channel_path
1314913
def get_channel(self, name):
        
        name = quote(name, '')
        path = Client.urls['channels_by_name'] % name
        chan = self._call(path, 'GET')
        return chan
103261
def get_channel_info(self):
        
        csv_filename = get_metadata_file_path(channeldir=self.channeldir, filename=self.channelinfo)
        csv_lines = _read_csv_lines(csv_filename)
        dict_reader = csv.DictReader(csv_lines)
        channel_csvs_list =  list(dict_reader)
        channel_csv = channel_csvs_list[0]
        if len(channel_csvs_list) > 1:
            raise ValueError('Found multiple channel rows in ' + self.channelinfo)
        channel_cleaned = _clean_dict(channel_csv)
        channel_info = self._map_channel_row_to_dict(channel_cleaned)
        return channel_info
869385
def get_thumbnail_paths(self):
        
        thumbnail_path_tuples = []
        # channel thumbnail
        channel_info = self.get_channel_info()
        chthumbnail_path = channel_info.get('thumbnail_chan_path', None)
        if chthumbnail_path:
            chthumbnail_path_tuple = path_to_tuple(chthumbnail_path, windows=self.winpaths)
            thumbnail_path_tuples.append(chthumbnail_path_tuple)
        # content thumbnails
        for content_file_path_tuple, row in self.contentcache.items():
            thumbnail_path = row.get('thumbnail_chan_path', None)
            if thumbnail_path:
                thumbnail_path_tuple = path_to_tuple(thumbnail_path, windows=self.winpaths)
                thumbnail_path_tuples.append(thumbnail_path_tuple)
        return thumbnail_path_tuples
450904
def channel(self, channel_id=None, auto_encode_decode=True):
        """"""
        try:
            return self.channels[channel_id]
        except KeyError:
            return self.Channel(self, channel_id,
                                auto_encode_decode=auto_encode_decode)
1138551
def _get_channel(self):
        
        channel = self._transport.open_session()
        channel.set_combine_stderr(True)
        channel.get_pty()
        return channel
407486
def path(self) -> str:
        
        path: str = ELIBConfig.config_sep_str.join(self._raw_path)
        if ELIBConfig.root_path:
            prefix = ELIBConfig.config_sep_str.join(ELIBConfig.root_path)
            path = ELIBConfig.config_sep_str.join((prefix, path))
        return path
1316088
def _get_socket_paths(self):
        
        socket_pattern = os.path.join(self.config['socket_path'],
                                      (self.config['socket_prefix'] +
                                       '*.' + self.config['socket_ext']))
        return glob.glob(socket_pattern)
829977
def get_channel(self, name):
        
        return self._api_get('/api/channels/{0}'.format(
            urllib.parse.quote_plus(name)
        ))
507768
def _inc_path(self):
        """"""
        newpos = self._str2int(self.path[-self.steplen:]) + 1
        key = self._int2str(newpos)
        if len(key) > self.steplen:
            raise PathOverflow(_("Path Overflow from: '%s'" % (self.path, )))
        return '{0}{1}{2}'.format(
            self.path[:-self.steplen],
            self.alphabet[0] * (self.steplen - len(key)),
            key
        )
941860
def command_path(self):
        
        rv = ''
        if self.info_name is not None:
            rv = self.info_name
        if self.parent is not None:
            rv = self.parent.command_path + ' ' + rv
        return rv.lstrip()
336106
def get_spyder_pythonpath(self):
        """"""
        active_path = [p for p in self.path if p not in self.not_active_path]
        return active_path + self.project_path
475440
def get_paths(rlz):
    
    dic = {}
    if hasattr(rlz, 'sm_lt_path'):  # composite realization
        dic['source_model_tree_path'] = '_'.join(rlz.sm_lt_path)
        dic['gsim_tree_path'] = '_'.join(rlz.gsim_lt_path)
    else:  # simple GSIM realization
        dic['source_model_tree_path'] = ''
        dic['gsim_tree_path'] = '_'.join(rlz.lt_path)
    return dic
514059
def __get_base_path(self):
        """"""
        entry = self.get()
        return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0],
                                             entry.name + "_base")
631025
def retrieve_download_path(self):
        
        section = self.name if self.config.has_section(
            self.name) else self.config.default_section
        download_path = self.config.get(
            section, 'Download directory', fallback='~/Podcasts')
        subdirectory = self.config.get(
            section, 'Create subdirectories', fallback='no')
        return [os.path.expanduser(download_path), subdirectory]
313785
def get_url(self, *paths, **params):
        
        path_stack = self._attribute_stack[:]
        if paths:
            path_stack.extend(paths)

        u = self._stack_collapser(path_stack)
        url = self._url_template % {
            "domain": self._api_url,
            "generated_url" : u,
        }

        if self._params or params:
            internal_params = self._params.copy()
            internal_params.update(params)
            url += self._generate_params(internal_params)

        return url
543804
def load_channels(self):
        
        channels = []

        # Try to get channels
        for channel_name in self.channel_names:
            channel_path = os.path.join(self.path, "channels")
            sys.path.append(self.path)
            mod = imp.load_module(channel_name, *imp.find_module(channel_name, [channel_path]))
            cls = getattr(mod, channel_name.title().replace("_", ""))
            channel_id = channel_name.split("_")[0]
            # TODO: what about up_to_timestamp?
            try:
                channels.append(cls(channel_id, up_to_timestamp=None))
            except TypeError:
                channels.append(cls(channel_id))

        # Try to get tools
        if self.has_tools:
            tool_path = os.path.join(self.path, "tools")
            # Create a tool channel using this path
            channel_id = self.channel_id_prefix + "_" + "tools"
            channel = ToolChannel(channel_id, tool_path, up_to_timestamp=utcnow())
            channels.append(channel)

        if self.has_assets:
            assset_path = os.path.join(os.path.abspath(self.path), "assets")
            channel_id = self.channel_id_prefix + "_" + "assets"
            channel = AssetsFileChannel(channel_id, assset_path, up_to_timestamp=utcnow())
            channels.append(channel)
            #
            # from . import TimeInterval
            # channel.streams.values()[0].window(TimeInterval.up_to_now()).items()

        return channels