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
7 # Run `:avfs' to browse the selected archive.
9 from __future__
import (absolute_import
, division
, print_function
)
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")
22 if os
.path
.isdir(self
.avfs_root
):
23 archive_directory
= "".join([
25 self
.fm
.thisfile
.path
,
28 if os
.path
.isdir(archive_directory
):
29 self
.fm
.cd(archive_directory
)
31 self
.fm
.notify("This file cannot be handled by avfs.", bad
=True)
33 self
.fm
.notify("Install `avfs' and run `mountavfs' first.", bad
=True)