Correct the description of 'quit'
[ranger.git] / examples / plugin_avfs.py
blob07968a0353826bcb147164615f7c09670333b18d
1 # Tested with ranger 1.9.1
3 # A very simple and possibly buggy support for AVFS
4 # (http://avf.sourceforge.net/), that allows ranger to handle
5 # archives.
7 # Run `:avfs' to browse the selected archive.
9 from __future__ import (absolute_import, division, print_function)
11 import os
12 import os.path
14 from ranger.api.commands import Command
17 class avfs(Command): # pylint: disable=invalid-name
18 avfs_root = os.path.join(os.environ["HOME"], ".avfs")
19 avfs_suffix = "#"
21 def execute(self):
22 if os.path.isdir(self.avfs_root):
23 archive_directory = "".join([
24 self.avfs_root,
25 self.fm.thisfile.path,
26 self.avfs_suffix,
28 if os.path.isdir(archive_directory):
29 self.fm.cd(archive_directory)
30 else:
31 self.fm.notify("This file cannot be handled by avfs.", bad=True)
32 else:
33 self.fm.notify("Install `avfs' and run `mountavfs' first.", bad=True)