summary refs log blame commit diff stats
path: root/test/testlib.py
blob: 29dd9e078db7365889a0a05e2ef03a7e1b3110fb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                       



























                                               
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

def TODO(fnc):
	def result(*arg, **kw):
		try:
			fnc(*arg, **kw)
		except:
			pass # failure expected
	return result

class Fake(object):
	def __getattr__(self, attrname):
		val = Fake()
		self.__dict__[attrname] = val
		return val

	def __call__(self, *_, **__):
		return Fake()

	def __clear__(self):
		self.__dict__.clear()

	def __iter__(self):
		return iter(())

class OK(Exception):
	pass

def raise_ok(*_, **__):
	raise OK()
ws (with "scope.sh"): * img2txt (from caca-utils) for ASCII-art image previews * highlight for syntax highlighting of code * atool for previews of archives * lynx, w3m or elinks for previews of html pages * pdftotext for pdf previews * transmission-show for viewing bit-torrent information * mediainfo or exiftool for viewing information about media files Installing ---------- Use the package manager of your operating system to install ranger. Note that ranger can be started without installing by simply running ranger.py. To install ranger manually: sudo make install This translates roughly to: sudo python setup.py install --optimize=1 --record=install_log.txt This also saves a list of all installed files to install_log.txt, which you can use to uninstall ranger. Getting Started --------------- After starting ranger, you can use the Arrow Keys (or hjkl) to navigate, Enter to open a file or type Q to quit. The third column shows a preview of the current file. The second is the main column and the first shows the parent directory. Ranger can automatically copy default configuration files to ~/.config/ranger if you run it with the switch --copy-config. (see ranger --help for a description of that switch.) Also check ranger/config/ for the default configuration.