about summary refs log blame commit diff stats
path: root/examples/plugin_fasd_add.py
blob: c107ecc1fa957728415599043d303368c9f284b9 (plain) (tree)
























                                                                  
# This plugin adds opened files to `fasd`

from __future__ import (absolute_import, division, print_function)

import subprocess

import ranger.api
from ranger.ext.spawn import check_output


HOOK_INIT_OLD = ranger.api.hook_init


def hook_init(fm):
    def fasd_add():
        for fobj in fm.thistab.get_selection():
            try:
                check_output(['fasd', '--add', fobj.path])
            except subprocess.CalledProcessError:
                pass
    fm.signal_bind('execute.before', fasd_add)
    return HOOK_INIT_OLD(fm)


ranger.api.hook_init = hook_init
ass="kc">true, "raw": "plotly.js-dist-min", "name": "plotly.js-dist-min", "escapedName": "plotly.js-dist-min", "rawSpec": "", "saveSpec": null, "fetchSpec": "latest" }, "_requiredBy": [ "#USER", "/" ], "_resolved": "https://registry.npmjs.org/plotly.js-dist-min/-/plotly.js-dist-min-2.4.2.tgz", "_shasum": "675a1d6d4828f7d9326926c05386a5e4231ee4b3", "_spec": "plotly.js-dist-min", "_where": "/home/andinus/projects/website/static/scripts", "author": { "name": "Plotly, Inc." }, "bugs": { "url": "https://github.com/plotly/plotly.js/issues" }, "bundleDependencies": false, "deprecated": false, "description": "Ready-to-use minified plotly.js distributed bundle.", "files": [ "LICENSE", "README.md", "plotly.min.js" ], "homepage": "https://github.com/plotly/plotly.js#readme", "keywords": [ "graphing", "plotting", "data", "visualization", "plotly" ], "license": "MIT", "main": "plotly.min.js", "name": "plotly.js-dist-min", "repository": { "type": "git", "url": "git+https://github.com/plotly/plotly.js.git" }, "version": "2.4.2" }