Load all bookmarks for a specific file from config.
761116
def load_bookmarks(filename):
    """"""
    bookmarks = _load_all_bookmarks()
    return {k: v for k, v in bookmarks.items() if v[0] == filename}
740649
def _load_file(self, f):
        """"""
        try:
            with open(f, 'r') as _fo:
                _seria_in = seria.load(_fo)
                _y = _seria_in.dump('yaml')
        except IOError:
            raise FiggypyError("could not open configuration file")
        self.values.update(yaml.load(_y))
334393
def metafetcher(bamfile, metacontig2contig, metatag):
    ''' '''
    for metacontig in metacontig2contig:
        for contig in metacontig2contig[metacontig]:
            for read in bamfile.fetch(contig):
                read.set_tag(metatag, metacontig)
                yield read
869490
def _load_config_file(self):
        """"""
        with open(self._config_file) as f:
            config = yaml.safe_load(f)
            patch_config(config, self.__environment_configuration)
            return config
1197072
def _load_values(self):
        """"""
        path = self._config_path()
        if path is not None and os.path.isfile(path):
            self._load_file(path)
813006
def _load_all(self):
        '''
        
        '''
        with self._lock:
            for name in self.file_mapping:
                if name in self.loaded_files or name in self.missing_modules:
                    continue
                self._load_module(name)

            self.loaded = True
80069
def load(self, filething, **kwargs):
        """"""

        fileobj = filething.fileobj

        try:
            self.tags = _IFFID3(fileobj, **kwargs)
        except ID3NoHeaderError:
            self.tags = None
        except ID3Error as e:
            raise error(e)
        else:
            self.tags.filename = self.filename

        fileobj.seek(0, 0)
        self.info = AIFFInfo(fileobj)
797107
def load_config_files(name, force=false)
      name = name.to_s

      # Return last config file hash list loaded,
      # if reload is disabled and files have already been loaded.
      return self.cache_config_files[name] if self.reload_disabled? && self.cache_config_files[name]

      logger.info "Loading config files for: #{name}"
      logger.debug "load_config_files(#{name.inspect})"

      # Get current time for checking last loaded status.
      now = Time.now

      # Get array of all the existing files file the config name.
      config_files = self.get_config_files(name)

      # Get all the data from all yaml files into as configs
      configs = config_files.collect do |f|
        name, name_with_suffix, filename, ext, modified_time = * f

        # Get the cached file info the specific file, if
        # it's been loaded before.
        config_data, last_modified, last_loaded = self.cache[filename]

        logger.debug "f = #{f.inspect}\n" +
          "cache #{name_with_suffix} filename      = #{filename.inspect}\n" +
          "cache #{name_with_suffix} config_data   = #{config_data.inspect}\n" +
          "cache #{name_with_suffix} last_modified = #{last_modified.inspect}\n" +
          "cache #{name_with_suffix} last_loaded   = #{last_loaded.inspect}\n"

        # Load the file if its never been loaded or its been more than
        # so many minutes since last load attempt. (default: 5 minutes)
        if config_data.blank? || (now - last_loaded > self.reload_interval)
          if force || config_data.blank? || modified_time != last_modified

            logger.debug "modified_time #{name.inspect} #{filename.inspect} " +
              "changed #{modified_time != last_modified} : #{modified_time.inspect} #{last_modified.inspect}"

            logger.debug "RConfig: loading #{filename.inspect}"

            config_data = read(filename, name, ext)  # Get contents from config file

            logger.debug "RConfig: loaded #{filename.inspect} => #{config_data.inspect}"

            (self.config_loaded ||= {})[name] = config_files  # add files to the loaded files cache

            self.cache[filename] = [config_data, modified_time, now]  # Save cached config file contents, and modified_time.

            logger.debug "cache[#{filename.inspect}] = #{self.cache[filename].inspect}"

            self.cache_hash[name] = nil # Flush merged hash cache.

            self.cache_files[name] = config_files  # Config files changed or disappeared.

          end # if config_data == nil || (now - last_loaded > self.reload_interval)
        end # if force || config_data == nil || modified_time != last_modified

        config_data
      end # config_files.collect
      configs.compact!

      logger.debug "load_config_files(#{name.inspect}) => #{configs.inspect}"

      # Keep last loaded config files around in case self.reload_dsabled.
      self.cache_config_files[name] = configs #unless configs.empty?

      configs
    end
507209
def load_bookmark(self, slot_num):
        """"""
        bookmarks = CONF.get('editor', 'bookmarks')
        if slot_num in bookmarks:
            filename, line_num, column = bookmarks[slot_num]
        else:
            return
        if not osp.isfile(filename):
            self.last_edit_cursor_pos = None
            return
        self.load(filename)
        editor = self.get_current_editor()
        if line_num < editor.document().lineCount():
            linelength = len(editor.document()
                             .findBlockByNumber(line_num).text())
            if column <= linelength:
                editor.go_to_line(line_num + 1, column)
            else:
                # Last column
                editor.go_to_line(line_num + 1, linelength)
1150549
def load(cls, filename=None):
        """"""
        if filename is None:
            LOGGER.debug("Loading default configuration.")
            with open_text(templates, "test_config.yml",
                           encoding="utf-8") as file_handle:
                content = yaml.load(file_handle)
        else:
            LOGGER.debug("Loading custom configuration '%s'.", filename)
            try:
                with open(filename, encoding="utf-8") as file_handle:
                    content = yaml.load(file_handle)
            except IOError as err:
                LOGGER.error(
                    "Failed to load the custom configuration '%s'. Skipping.",
                    filename)
                LOGGER.debug(str(err))
                content = dict()
        return cls(content)
473029
def _load(self, files_in, files_out, urlpath, meta=True):
        """"""
        import dask
        out = []
        outnames = []
        for file_in, file_out in zip(files_in, files_out):
            cache_path = file_out.path
            outnames.append(cache_path)

            # If `_munge_path` did not find a match we want to avoid
            # writing to the urlpath.
            if cache_path == urlpath:
                continue

            if not os.path.isfile(cache_path):
                logger.debug("Caching file: {}".format(file_in.path))
                logger.debug("Original path: {}".format(urlpath))
                logger.debug("Cached at: {}".format(cache_path))
                if meta:
                    self._log_metadata(urlpath, file_in.path, cache_path)
                ddown = dask.delayed(_download)
                out.append(ddown(file_in, file_out, self.blocksize,
                                 self.output))
        dask.compute(*out)
        return outnames
871844
def load(self, file_path):
        '''  '''
        self.clear()
        self.__config = self.read_file(file_path)
1325229
def load(self, filename=None, ignore_discard=False, ignore_expires=False):
        """"""
        if filename is None:
            if self.filename is not None: filename = self.filename
            else: raise ValueError(MISSING_FILENAME_TEXT)

        f = open(filename)
        try:
            self._really_load(f, filename, ignore_discard, ignore_expires)
        finally:
            f.close()
1186499
def _load(self):
        """'"""
        # loop over system path
        if self._loaded:
            return
        icon_paths = ['/usr/local/share/meqtrees'] + sys.path
        for path in icon_paths:
            path = path or '.'
            # for each entry, try <entry>/icons/<appname>'
            for a, b in [('icons', self._appname), (self._appname, 'icons')]:
                trydir = os.path.join(path, a, b)
                _dprint(3, 'trying icon path', trydir)
                try:
                    files = os.listdir(trydir)
                except:
                    continue
                _dprint(3, len(files), 'entries in', trydir)
                # loop over all files
                nicons = 0
                for f in files:
                    (name, ext) = os.path.splitext(f);  # check extension
                    if ext in ('.png', '.xpm', '.gif'):
                        f = os.path.join(trydir, f)
                        try:
                            pm = QPixmap(f)
                        except:
                            _dprint(3, 'error loading icon', name, sys.exc_value())
                            continue
                        # register pixmap
                        self._pixmaps[name] = QPixmapWrapper(pm)
                        nicons += 1
                        _dprint(4, 'loaded icon', f)
                    else:
                        _dprint(4, 'ignoring entry', f)
                _dprint(1, nicons, 'icons loaded from ', trydir)
                self._loaded = True
848906
def load_files(files):
    """"""

    for py_file in files:
        LOG.debug("exec %s", py_file)
        execfile(py_file, globals(), locals())
1253771
def load(self):
        """"""
        try:
            with open(self.config_file) as configfile:
                self.config = yaml.load(configfile)
        except TypeError:
            # no config file (use environment variables)
            pass
        if self.config:
            self.prefix = self.config.get('config_prefix', None)
        if not self.prefix:
            if os.getenv(self.config_prefix):
                self.prefix = os.getenv(self.config_prefix)
            else:
                for path in [
                    os.path.join(self.basepath, self.default_file),
                    os.path.join(self.config_root, self.default_file)
                ]:
                    if os.path.exists(path):
                        with open(path) as conf:
                            config = yaml.load(conf)
                            prefix = config.get(
                                self.config_prefix.lower(), None
                            )
                            if prefix:
                                self.prefix = prefix
                                break
357710
def load_config_file(self, path, profile=None):
        """"""
        config_cls = self.get_config_reader()
        return config_cls.load_config(self, path, profile=profile)