forked from solderpunk/AV-98
View raw gemtext with `cat raw` & `less raw`.
This commit is contained in:
parent
e79438c2e2
commit
596d2c48ad
20
av98.py
20
av98.py
|
@ -1390,15 +1390,25 @@ Use 'ls -l' to see URLs."""
|
|||
### Stuff that does something to most recently viewed item
|
||||
@needs_gi
|
||||
def do_cat(self, *args):
|
||||
"""Run most recently visited item through "cat" command."""
|
||||
subprocess.call(shlex.split("cat %s" % self._get_active_tmpfile()))
|
||||
"""Run most recently visited item through "cat" command.
|
||||
'cat raw' displays the raw version of the item."""
|
||||
tmp_file = self.tmp_filename if args[0] == 'raw'\
|
||||
else self._get_active_tmpfile()
|
||||
subprocess.call(shlex.split("cat %s" % tmp_file))
|
||||
|
||||
@needs_gi
|
||||
def do_less(self, *args):
|
||||
"""Run most recently visited item through "less" command."""
|
||||
"""Run most recently visited item through "less" command.
|
||||
'less raw' displays the raw version of the item."""
|
||||
if args[0] == 'raw':
|
||||
tmp_file = self.tmp_filename
|
||||
less_opt = '-R'
|
||||
else:
|
||||
tmp_file = self._get_active_tmpfile()
|
||||
less_opt = '-r'
|
||||
cmd_str = self._get_handler_cmd(self.mime)
|
||||
cmd_str = cmd_str % self._get_active_tmpfile()
|
||||
subprocess.call("%s | less -R" % cmd_str, shell=True)
|
||||
cmd_str = cmd_str % tmp_file
|
||||
subprocess.call("%s | less %s" % (cmd_str, less_opt), shell=True)
|
||||
|
||||
@needs_gi
|
||||
def do_fold(self, *args):
|
||||
|
|
Loading…
Reference in New Issue