From c7720fff4fc500dab7cfb2d2b3b63e2b966502d2 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 24 Sep 2011 17:57:00 +0200 Subject: Overhauled manpage. It's in POD format now. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fd525721..1c0b5fda 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,10 @@ doc: cleandoc pydoc.writedocs("$(CWD)")' find . -name \*.html -exec sed -i 's|'$(CWD)'|../..|g' -- {} \; +man: + pod2man --stderr --center='ranger manual' --date='$(NAME)-$(VERSION)' \ + --release=$(shell date +%x) doc/ranger.pod doc/ranger.1 + cleandoc: test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html || true @@ -75,4 +79,4 @@ bm: snapshot: git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME) -.PHONY: default options compile clean doc cleandoc test bm snapshot install +.PHONY: default options compile clean doc cleandoc test bm snapshot install man -- cgit 1.4.1-2-gfad0 From 8d21b83ce6f77e3e348930e3ee45935917ee2e34 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 25 Sep 2011 00:46:57 +0200 Subject: extended manpage and fixed {load,save}_copy_buffer commands --- Makefile | 3 +++ doc/ranger.1 | 64 +++++++++++++++++++++++++++------------------ doc/ranger.pod | 48 +++++++++++++++++++--------------- ranger/defaults/commands.py | 13 ++++++--- 4 files changed, 78 insertions(+), 50 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1c0b5fda..ed100a8e 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,9 @@ man: pod2man --stderr --center='ranger manual' --date='$(NAME)-$(VERSION)' \ --release=$(shell date +%x) doc/ranger.pod doc/ranger.1 +manhtml: + pod2html doc/ranger.pod --outfile=doc/ranger.1.html + cleandoc: test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html || true diff --git a/doc/ranger.1 b/doc/ranger.1 index 9fc64759..406297bd 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.4.3" "09/24/2011" "ranger manual" +.TH RANGER 1 "ranger-1.4.3" "09/25/2011" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -194,8 +194,8 @@ down 5 lines, \fI2l\fR to open a file in mode 2, \fI10\fR to mark 10 file or \fI3?\fR to read the third chapter of the documentation. .PP Key bindings can be changed. Detailed instructions for this are in the -key binding configuration file at ranger/defaults/keys.py. You can copy it to -your local configuration directory with the \-\-copy\-config option. +key binding configuration file at \fIranger/defaults/keys.py\fR. You can copy it +to your local configuration directory with the \-\-copy\-config option. .IP "h, j, k, l" 14 .IX Item "h, j, k, l" Move left, down, up or right @@ -351,9 +351,10 @@ This section lists all built-in settings of ranger. The valid types for the value are in [brackets]. The hotkey to toggle the setting is in , if a hotkey exists. .PP -Settings can be changed in the file ~/.config/ranger/options.py or on the fly -with the command \fB:set option value\fR. Examples: \f(CW\*(C`:set column_ratios (1,2,3)\*(C'\fR, -\&\f(CW\*(C`:set show_hidden=True\*(C'\fR +Settings can be changed in the file \fI~/.config/ranger/options.py\fR or on the +fly with the command \fB:set option value\fR. Examples: + :set column_ratios (1,2,3) + :set show_hidden=True .IP "autosave_bookmarks [bool]" 4 .IX Item "autosave_bookmarks [bool]" Save bookmarks (used with mX and `X) instantly? This helps to synchronize @@ -363,8 +364,8 @@ loss. When false, bookmarks are saved when ranger is exited. .IX Item "collapse_preview [bool] " When no preview is visible, should the last column be squeezed to make use of the whitespace? -.IP "colorscheme_overlay [python function, None]" 4 -.IX Item "colorscheme_overlay [python function, None]" +.IP "colorscheme_overlay [function, None]" 4 +.IX Item "colorscheme_overlay [function, None]" An overlay function for colorschemes. See the default options.py for an explanation and an example. .IP "colorscheme [string]" 4 @@ -400,8 +401,8 @@ Draw borders around columns? Flush the input after each key hit? One advantage is that when scrolling down with \*(L"j\*(R", ranger stops scrolling instantly when you release the key. One disadvantage is that when you type commands blindly, some keys might get lost. -.IP "hidden_filter [regular expression]" 4 -.IX Item "hidden_filter [regular expression]" +.IP "hidden_filter [regexp]" 4 +.IX Item "hidden_filter [regexp]" A regular expression pattern for files which should be hidden. .IP "max_console_history_size [integer, None]" 4 .IX Item "max_console_history_size [integer, None]" @@ -450,7 +451,8 @@ Show dotfiles in the bookmark preview window? (Type ') Show hidden files? .IP "sort_case_insensitive [bool] " 4 .IX Item "sort_case_insensitive [bool] " -Sort case-insensitively? If true, \*(L"a\*(R" will be listed before \*(L"B\*(R" even though its \s-1ASCII\s0 value is higher. +Sort case-insensitively? If true, \*(L"a\*(R" will be listed before \*(L"B\*(R" even though +its \s-1ASCII\s0 value is higher. .IP "sort_directories_first [bool] " 4 .IX Item "sort_directories_first [bool] " Sort directories first? @@ -481,6 +483,14 @@ Enable this if key combinations with the Alt Key don't work for you. (Especially on xterm) .SH "COMMANDS" .IX Header "COMMANDS" +.IP "bulkrename" 2 +.IX Item "bulkrename" +This command opens a list of selected files in an external editor. After you +edit and save the file, it will generate a shell script which does bulk +renaming according to the changes you did in the file. +.Sp +This shell script is opened in an editor for you to review. After you close +it, it will be executed. .IP "cd [\fIdirectory\fR]" 2 .IX Item "cd [directory]" The cd command changes the directory. The command \f(CW\*(C`:cd \-\*(C'\fR is equivalent to @@ -532,8 +542,8 @@ it will be run immediately. (Or entered, if it's a directory.) Looks for a string in all marked files or directories. .IP "load_copy_buffer" 2 .IX Item "load_copy_buffer" -Load the copy buffer from \fIconfdir/copy_buffer\fR. This can be used to pass the -list of copied files to another ranger instance. +Load the copy buffer from \fI~/.config/ranger/copy_buffer\fR. This can be used to +pass the list of copied files to another ranger instance. .IP "mark \fIpattern\fR" 2 .IX Item "mark pattern" Mark all files matching the regular expression pattern. @@ -577,13 +587,14 @@ Assigns a new value to an option. Valid options are listed in the settings section. Use tab completion to get the current value of an option, though this doesn't work for functions and regular expressions. Valid values are: .Sp -.Vb 7 +.Vb 8 \& None None \& bool True or False +\& integer 0 or 1 or \-1 or 2 etc. \& list [1, 2, 3] \& tuple 1, 2, 3 or (1, 2, 3) \& function lambda : -\& regexp regexp(\*(Aq\*(Aq) +\& regexp regexp(\*(Aq\*(Aq) \& string Anything .Ve .IP "shell [\-\fIflags\fR] \fIcommand\fR" 2 @@ -601,18 +612,21 @@ Unmark all files matching a regular expression pattern. .SH "FILES" .IX Header "FILES" ranger reads several configuration files which are located in -\&\f(CW$HOME\fR/.config/ranger or \f(CW$XDG_CONFIG_HOME\fR/ranger if \f(CW$XDG_CONFIG_HOME\fR is defined. -The configuration is done mostly in python. When removing a configuration file, -remove its compiled version too. (Python automatically compiles modules. -Since python3 they are saved in the _\|_pycache_\|_ directory, earlier versions -store them with the .pyc extension in the same directory.) +\&\fI\f(CI$HOME\fI/.config/ranger\fR or \fI\f(CI$XDG_CONFIG_HOME\fI/ranger\fR if \f(CW$XDG_CONFIG_HOME\fR is +defined. The configuration is done mostly in python. When removing a +configuration file, remove its compiled version too. (Python automatically +compiles modules. Since python3 they are saved in the _\|_pycache_\|_ directory, +earlier versions store them with the .pyc extension in the same directory.) .PP Use the \-\-copy\-config option to obtain the default configuration files. They include further documentation and it's too much to put here. .PP You don't need to copy the whole file though, most configuration files are -overlaid on top of the defaults (options.py, command.py, keys.py) or can be -sub-classed (apps.py, colorschemes). +overlaid on top of the defaults (\fIoptions.py\fR, \fIcommand.py\fR, \fIkeys.py\fR) or +can be sub-classed (\fIapps.py\fR, \fIcolorschemes\fR). +.PP +When starting ranger with the \fB\-\-clean\fR option, it will not access or create +any of these files. .SS "\s-1CONFIGURATION\s0" .IX Subsection "CONFIGURATION" .IP "apps.py" 10 @@ -673,7 +687,7 @@ Defines the shell that ranger is going to use with the :shell command and the \*(L"S\*(R" key. Defaults to \*(L"bash\*(R". .IP "\s-1XDG_CONFIG_HOME\s0" 8 .IX Item "XDG_CONFIG_HOME" -Specifies the directory for configuration files. Defaults to \*(L"$HOME/.config\*(R". +Specifies the directory for configuration files. Defaults to \fI\f(CI$HOME\fI/.config\fR. .SH "EXAMPLES" .IX Header "EXAMPLES" .SS "\s-1VIM:\s0 File Chooser" @@ -694,8 +708,8 @@ opening in your current vim session. .Ve .SS "Bash: cd to last path after exit" .IX Subsection "Bash: cd to last path after exit" -This is a bash function (to put in your ~/.bashrc) to change the directory to -the last visited one after ranger quits. You can always type \f(CW\*(C`cd \-\*(C'\fR to go +This is a bash function (to put in your \fI~/.bashrc\fR) to change the directory +to the last visited one after ranger quits. You can always type \f(CW\*(C`cd \-\*(C'\fR to go back to the original one. .PP .Vb 9 diff --git a/doc/ranger.pod b/doc/ranger.pod index 38b3ca17..8f6cc62a 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -93,8 +93,8 @@ down 5 lines, I<2l> to open a file in mode 2, I<10> to mark 10 files or I<3?> to read the third chapter of the documentation. Key bindings can be changed. Detailed instructions for this are in the -key binding configuration file at ranger/defaults/keys.py. You can copy it to -your local configuration directory with the --copy-config option. +key binding configuration file at F. You can copy it +to your local configuration directory with the --copy-config option. =over 14 @@ -320,9 +320,10 @@ This section lists all built-in settings of ranger. The valid types for the value are in [brackets]. The hotkey to toggle the setting is in , if a hotkey exists. -Settings can be changed in the file ~/.config/ranger/options.py or on the fly -with the command B<:set option value>. Examples: C<:set column_ratios (1,2,3)>, -C<:set show_hidden=True> +Settings can be changed in the file F<~/.config/ranger/options.py> or on the +fly with the command B<:set option value>. Examples: + :set column_ratios (1,2,3) + :set show_hidden=True =over @@ -337,7 +338,7 @@ loss. When false, bookmarks are saved when ranger is exited. When no preview is visible, should the last column be squeezed to make use of the whitespace? -=item colorscheme_overlay [python function, None] +=item colorscheme_overlay [function, None] An overlay function for colorschemes. See the default options.py for an explanation and an example. @@ -384,7 +385,7 @@ Flush the input after each key hit? One advantage is that when scrolling down with "j", ranger stops scrolling instantly when you release the key. One disadvantage is that when you type commands blindly, some keys might get lost. -=item hidden_filter [regular expression] +=item hidden_filter [regexp] A regular expression pattern for files which should be hidden. @@ -448,7 +449,8 @@ Show hidden files? =item sort_case_insensitive [bool] -Sort case-insensitively? If true, "a" will be listed before "B" even though its ASCII value is higher. +Sort case-insensitively? If true, "a" will be listed before "B" even though +its ASCII value is higher. =item sort_directories_first [bool] @@ -561,8 +563,8 @@ Looks for a string in all marked files or directories. =item load_copy_buffer -Load the copy buffer from I. This can be used to pass the -list of copied files to another ranger instance. +Load the copy buffer from F<~/.config/ranger/copy_buffer>. This can be used to +pass the list of copied files to another ranger instance. =item mark I @@ -618,10 +620,11 @@ doesn't work for functions and regular expressions. Valid values are: None None bool True or False + integer 0 or 1 or -1 or 2 etc. list [1, 2, 3] tuple 1, 2, 3 or (1, 2, 3) function lambda : - regexp regexp('') + regexp regexp('') string Anything =item shell [-I] I @@ -648,18 +651,21 @@ Unmark all files matching a regular expression pattern. =head1 FILES ranger reads several configuration files which are located in -$HOME/.config/ranger or $XDG_CONFIG_HOME/ranger if $XDG_CONFIG_HOME is defined. -The configuration is done mostly in python. When removing a configuration file, -remove its compiled version too. (Python automatically compiles modules. -Since python3 they are saved in the __pycache__ directory, earlier versions -store them with the .pyc extension in the same directory.) +F<$HOME/.config/ranger> or F<$XDG_CONFIG_HOME/ranger> if $XDG_CONFIG_HOME is +defined. The configuration is done mostly in python. When removing a +configuration file, remove its compiled version too. (Python automatically +compiles modules. Since python3 they are saved in the __pycache__ directory, +earlier versions store them with the .pyc extension in the same directory.) Use the --copy-config option to obtain the default configuration files. They include further documentation and it's too much to put here. You don't need to copy the whole file though, most configuration files are -overlaid on top of the defaults (options.py, command.py, keys.py) or can be -sub-classed (apps.py, colorschemes). +overlaid on top of the defaults (F, F, F) or +can be sub-classed (F, F). + +When starting ranger with the B<--clean> option, it will not access or create +any of these files. =head2 CONFIGURATION @@ -747,7 +753,7 @@ the "S" key. Defaults to "bash". =item XDG_CONFIG_HOME -Specifies the directory for configuration files. Defaults to "$HOME/.config". +Specifies the directory for configuration files. Defaults to F<$HOME/.config>. =back @@ -773,8 +779,8 @@ opening in your current vim session. =head2 Bash: cd to last path after exit -This is a bash function (to put in your ~/.bashrc) to change the directory to -the last visited one after ranger quits. You can always type C to go +This is a bash function (to put in your F<~/.bashrc>) to change the directory +to the last visited one after ranger quits. You can always type C to go back to the original one. function ranger-cd { diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index cb39ddf9..f25abc19 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -503,9 +503,11 @@ class load_copy_buffer(Command): from ranger.fsobject import File from os.path import exists try: - f = open(self.fm.confpath(self.copy_buffer_filename), 'r') + fname = self.fm.confpath(self.copy_buffer_filename) + f = open(fname, 'r') except: - return self.fm.notify("Cannot open file %s" % fname, bad=True) + return self.fm.notify("Cannot open %s" % \ + (fname or self.copy_buffer_filename), bad=True) self.fm.env.copy = set(File(g) \ for g in f.read().split("\n") if exists(g)) f.close() @@ -520,10 +522,13 @@ class save_copy_buffer(Command): """ copy_buffer_filename = 'copy_buffer' def execute(self): + fname = None try: - f = open(self.fm.confpath(self.copy_buffer_filename), 'w') + fname = self.fm.confpath(self.copy_buffer_filename) + f = open(fname, 'w') except: - return self.fm.notify("Cannot open file %s" % fname, bad=True) + return self.fm.notify("Cannot open %s" % \ + (fname or self.copy_buffer_filename), bad=True) f.write("\n".join(f.path for f in self.fm.env.copy)) f.close() -- cgit 1.4.1-2-gfad0 From b3bc8431554c8746bf8eef21237d15df6e2d5356 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 28 Sep 2011 21:19:29 +0200 Subject: removed tests. (half of them are outdated) To get them back, you can always simply revert this commit. --- Makefile | 10 +- test/all_benchmarks.py | 56 ---- test/all_tests.py | 37 --- test/bm_human_readable.py | 51 ---- test/bm_loader.py | 174 ------------- test/tc_ansi.py | 40 --- test/tc_bookmarks.py | 92 ------- test/tc_colorscheme.py | 53 ---- test/tc_direction.py | 92 ------- test/tc_directory.py | 124 --------- test/tc_displayable.py | 167 ------------ test/tc_ext.py | 150 ----------- test/tc_history.py | 82 ------ test/tc_human_readable.py | 51 ---- test/tc_keyapi.py | 45 ---- test/tc_loader.py | 79 ------ test/tc_newkeys.py | 620 -------------------------------------------- test/tc_relative_symlink.py | 47 ---- test/tc_signal.py | 139 ---------- test/tc_ui.py | 69 ----- test/tc_utfwidth.py | 46 ---- test/testdir/largefile.txt | 1 - test/testdir/symlink | 1 - test/testdir/textfile.txt | 4 - test/testdir/zerobytes | 0 test/testlib.py | 43 --- 26 files changed, 1 insertion(+), 2272 deletions(-) delete mode 100755 test/all_benchmarks.py delete mode 100755 test/all_tests.py delete mode 100644 test/bm_human_readable.py delete mode 100644 test/bm_loader.py delete mode 100644 test/tc_ansi.py delete mode 100644 test/tc_bookmarks.py delete mode 100644 test/tc_colorscheme.py delete mode 100644 test/tc_direction.py delete mode 100644 test/tc_directory.py delete mode 100644 test/tc_displayable.py delete mode 100644 test/tc_ext.py delete mode 100644 test/tc_history.py delete mode 100644 test/tc_human_readable.py delete mode 100644 test/tc_keyapi.py delete mode 100644 test/tc_loader.py delete mode 100644 test/tc_newkeys.py delete mode 100644 test/tc_relative_symlink.py delete mode 100644 test/tc_signal.py delete mode 100644 test/tc_ui.py delete mode 100644 test/tc_utfwidth.py delete mode 100644 test/testdir/largefile.txt delete mode 120000 test/testdir/symlink delete mode 100644 test/testdir/textfile.txt delete mode 100644 test/testdir/zerobytes delete mode 100644 test/testlib.py (limited to 'Makefile') diff --git a/Makefile b/Makefile index ed100a8e..77fad740 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,6 @@ SETUPOPTS ?= '--record=install_log.txt' DOCDIR ?= doc/pydoc DESTDIR ?= / PYOPTIMIZE ?= 1 -BMCOUNT ?= 5 # how often to run the benchmarks? CWD = $(shell pwd) @@ -43,7 +42,6 @@ help: @echo 'make clean: Remove the compiled files (*.pyc, *.pyo)' @echo 'make cleandoc: Remove the pydoc documentation' @echo 'make snapshot: Create a tar.gz of the current git revision' - @echo 'make test: Run all unittests.' install: $(PYTHON) setup.py install $(SETUPOPTS) \ @@ -73,13 +71,7 @@ manhtml: cleandoc: test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html || true -test: - @$(PYTHON) test/all_tests.py 1 - -bm: - @$(PYTHON) test/all_benchmarks.py $(BMCOUNT) - snapshot: git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME) -.PHONY: default options compile clean doc cleandoc test bm snapshot install man +.PHONY: default options compile clean doc cleandoc snapshot install man diff --git a/test/all_benchmarks.py b/test/all_benchmarks.py deleted file mode 100755 index a3612701..00000000 --- a/test/all_benchmarks.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -""" -Run all the benchmarks inside this directory. -Usage: ./all_benchmarks.py [count] [regexp-filters...] -""" - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import re -import time - -if __name__ == '__main__': - count = int(sys.argv[1]) if len(sys.argv) > 1 else 10 - regexes = [re.compile(fltr) for fltr in sys.argv[2:]] - modules = (fname[:-3] for fname in os.listdir(sys.path[0]) \ - if fname[:3] == 'bm_' and fname[-3:] == '.py') - - def run_benchmark(cls, methodname): - full_method_name = "{0}.{1}".format(cls.__name__, methodname) - if all(re.search(full_method_name) for re in regexes): - method = getattr(cls(), methodname) - t1 = time.time() - try: - method(count) - except: - print("{0} failed!".format(full_method_name)) - raise - else: - t2 = time.time() - print("{0:60}: {1:10}s".format(full_method_name, t2 - t1)) - - for val in [__import__(module) for module in modules]: - for cls in vars(val).values(): - if type(cls) == type: - for methodname in vars(cls): - if methodname.startswith('bm_'): - run_benchmark(cls, methodname) diff --git a/test/all_tests.py b/test/all_tests.py deleted file mode 100755 index 0c184df5..00000000 --- a/test/all_tests.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -""" -Run all the tests inside this directory as a test suite. -Usage: ./all_tests.py [verbosity] -""" - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest - -if __name__ == '__main__': - verbosity = int(sys.argv[1]) if len(sys.argv) > 1 else 1 - tests = (fname[:-3] for fname in os.listdir(sys.path[0]) \ - if fname[:3] == 'tc_' and fname[-3:] == '.py') - suite = unittest.TestLoader().loadTestsFromNames(tests) - result = unittest.TextTestRunner(verbosity=verbosity).run(suite) - if len(result.errors + result.failures) > 0: - sys.exit(1) diff --git a/test/bm_human_readable.py b/test/bm_human_readable.py deleted file mode 100644 index ef400774..00000000 --- a/test/bm_human_readable.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -from ranger.ext.human_readable import * - -# The version before 2010/06/24: -import math -UNITS = 'BKMGTP' -MAX_EXPONENT = len(UNITS) - 1 -def human_readable_old(byte, seperator=' '): - if not byte: - return '0' - - exponent = int(math.log(byte, 2) / 10) - flt = round(float(byte) / (1 << (10 * exponent)), 2) - - if exponent > MAX_EXPONENT: - return '>9000' # off scale - - if int(flt) == flt: - return '%.0f%s%s' % (flt, seperator, UNITS[exponent]) - - else: - return '%.2f%s%s' % (flt, seperator, UNITS[exponent]) - -class benchmark_human_readable(object): - def bm_current(self, n): - for i in range(n): - human_readable((128 * i) % 2**50) - - def bm_old(self, n): - for i in range(n): - human_readable_old((128 * i) % 2**50) diff --git a/test/bm_loader.py b/test/bm_loader.py deleted file mode 100644 index 552954a7..00000000 --- a/test/bm_loader.py +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -from ranger.core.loader import Loader -from ranger.fsobject import Directory, File -from ranger.ext.openstruct import OpenStruct -import os.path -from ranger.shared import FileManagerAware, SettingsAware -from testlib import Fake -from os.path import realpath, join, dirname -from subprocess import Popen, PIPE -TESTDIR = realpath(join(dirname(__file__), '/usr/include')) - -def skip(x): - return - -def raw_load_content(self): - """ - The method which is used in a Directory object to load stuff. - Keep this up to date! - """ - - from os.path import join, isdir, basename - from os import listdir - import ranger.ext.mount_path - - self.loading = True - self.load_if_outdated() - - try: - if self.exists and self.runnable: - # 0.003s: - self.mount_path = ranger.ext.mount_path.mount_path(self.path) - - # 0.1s: - filenames = [] - for fname in listdir(self.path): - if not self.settings.show_hidden: - hfilter = self.settings.hidden_filter - if hfilter: - if isinstance(hfilter, str) and hfilter in fname: - continue - if hasattr(hfilter, 'search') and \ - hfilter.search(fname): - continue - if isinstance(self.filter, str) and self.filter \ - and self.filter not in fname: - continue - filenames.append(join(self.path, fname)) - # --- - - self.load_content_mtime = os.stat(self.path).st_mtime - - marked_paths = [obj.path for obj in self.marked_items] - - # 2.85s: - files = [] - for name in filenames: - if isdir(name): - try: - item = self.fm.env.get_directory(name) - except: - item = Directory(name) - else: - item = File(name) - item.load_if_outdated() - files.append(item) - - # 0.2s - self.disk_usage = sum(f.size for f in files if f.is_file) - - self.scroll_offset = 0 - self.filenames = filenames - self.files = files - - self._clear_marked_items() - for item in self.files: - if item.path in marked_paths: - self.mark_item(item, True) - else: - self.mark_item(item, False) - - self.sort() - - if len(self.files) > 0: - if self.pointed_obj is not None: - self.sync_index() - else: - self.move(to=0) - else: - self.filenames = None - self.files = None - - self.cycle_list = None - self.content_loaded = True - self.determine_infostring() - self.correct_pointer() - - finally: - self.loading = False - - -class benchmark_load(object): - def __init__(self): - self.loader = Loader() - fm = OpenStruct(loader=self.loader) - SettingsAware.settings = Fake() - FileManagerAware.fm = fm - self.dir = Directory(TESTDIR) - - def bm_run(self, n): - for _ in range(n): - self.dir.load_content(schedule=True) - while self.loader.has_work(): - self.loader.work() - - -@skip -class benchmark_raw_load(object): - def __init__(self): - SettingsAware.settings = Fake() - self.dir = Directory(TESTDIR) - - def bm_run(self, n): - generator = self.dir.load_bit_by_bit() - for _ in range(n): - raw_load_content(self.dir) - -def bm_loader(n): - """Do some random calculation""" - tloader = benchmark_load(N) - traw = benchmark_raw_load(N) - -class benchmark_load_varieties(object): - def bm_ls(self, n): - for _ in range(n): - Popen(["ls", '-l', TESTDIR], stdout=open(os.devnull, 'w')).wait() - - def bm_os_listdir_stat(self, n): - for _ in range(n): - for f in os.listdir(TESTDIR): - path = os.path.join(TESTDIR, f) - os.stat(path) - - def bm_os_listdir(self, n): - for _ in range(n): - for f in os.listdir(TESTDIR): - path = os.path.join(TESTDIR, f) - - def bm_os_listdir_stat_listdir(self, n): - for _ in range(n): - for f in os.listdir(TESTDIR): - path = os.path.join(TESTDIR, f) - os.stat(path) - if os.path.isdir(path): - os.listdir(path) diff --git a/test/tc_ansi.py b/test/tc_ansi.py deleted file mode 100644 index 0a6ad8b1..00000000 --- a/test/tc_ansi.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2010 David Barnett -# -# 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 . - -if __name__ == '__main__': from __init__ import init; init() - -import unittest -from ranger.gui import ansi - -class TestDisplayable(unittest.TestCase): - def test_char_len(self): - ansi_string = "X" - self.assertEqual(ansi.char_len(ansi_string), 1) - - def test_char_len2(self): - ansi_string = "XY" - self.assertEqual(ansi.char_len(ansi_string), 2) - - def test_char_len3(self): - ansi_string = "XY" - self.assertEqual(ansi.char_len(ansi_string), 2) - - def test_char_slice(self): - ansi_string = "XY" - expected = "X" - self.assertEqual(ansi.char_slice(ansi_string, 0, 1), expected) - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_bookmarks.py b/test/tc_bookmarks.py deleted file mode 100644 index 59435f06..00000000 --- a/test/tc_bookmarks.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -from os.path import realpath, join, dirname -import unittest -import os -import time - -from ranger.container.bookmarks import Bookmarks - -TESTDIR = realpath(join(dirname(__file__), 'testdir')) -BMFILE = join(TESTDIR, 'bookmarks') - -class TestDisplayable(unittest.TestCase): - def setUp(self): - try: - os.remove(BMFILE) - except: - pass - - def tearDown(self): - try: - os.remove(BMFILE) - except: - pass - - def test_adding_bookmarks(self): - bm = Bookmarks(BMFILE, str, autosave=False) - bm.load() - bm['a'] = 'fooo' - self.assertEqual(bm['a'], 'fooo') - - def test_sharing_bookmarks_between_instances(self): - bm = Bookmarks(BMFILE, str, autosave=True) - bm2 = Bookmarks(BMFILE, str, autosave=True) - - bm.load() - bm2.load() - bm['a'] = 'fooo' - self.assertRaises(KeyError, bm2.__getitem__, 'a') - - bm.save() - bm2.load() - self.assertEqual(bm['a'], bm2['a']) - - bm2['a'] = 'bar' - - bm.save() - bm2.save() - bm.load() - bm2.load() - - self.assertEqual(bm['a'], bm2['a']) - - def test_messing_around(self): - bm = Bookmarks(BMFILE, str, autosave=False) - bm2 = Bookmarks(BMFILE, str, autosave=False) - - bm.load() - bm['a'] = 'car' - - bm2.load() - self.assertRaises(KeyError, bm2.__getitem__, 'a') - - bm2.save() - bm.update() - bm.save() - bm.load() - bm2.load() - - self.assertEqual(bm['a'], bm2['a']) - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_colorscheme.py b/test/tc_colorscheme.py deleted file mode 100644 index eefb1e4f..00000000 --- a/test/tc_colorscheme.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -from unittest import TestCase, main -import random -import ranger.colorschemes -from ranger.gui.colorscheme import ColorScheme -from ranger.gui.context import CONTEXT_KEYS - -class Test(TestCase): - def setUp(self): - import random - import curses - curses.COLORS = 88 - schemes = [] - for key, mod in vars(ranger.colorschemes).items(): - if type(mod) == type(random): - for key, var in vars(mod).items(): - if type(var) == type and issubclass(var, ColorScheme) \ - and var != ColorScheme: - schemes.append(var) - self.schemes = set(schemes) - - def test_colorschemes(self): - def test(scheme): - scheme.get() # test with no arguments - - for i in range(300): # test with a bunch of random (valid) arguments - sample = random.sample(CONTEXT_KEYS, random.randint(2, 9)) - scheme.get(*sample) - - for scheme in self.schemes: - test(scheme()) - -if __name__ == '__main__': main() diff --git a/test/tc_direction.py b/test/tc_direction.py deleted file mode 100644 index 16c26dab..00000000 --- a/test/tc_direction.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -from ranger.ext.direction import Direction -from ranger.ext.openstruct import OpenStruct - -class TestDirections(unittest.TestCase): - def test_symmetry(self): - d1 = Direction(right=4, down=7, relative=True) - d2 = Direction(left=-4, up=-7, absolute=False) - - def subtest(d): - self.assertEqual(4, d.right()) - self.assertEqual(7, d.down()) - self.assertEqual(-4, d.left()) - self.assertEqual(-7, d.up()) - self.assertEqual(True, d.relative()) - self.assertEqual(False, d.absolute()) - - self.assertTrue(d.horizontal()) - self.assertTrue(d.vertical()) - - subtest(d1) - subtest(d2) - - def test_conflicts(self): - d3 = Direction(right=5, left=2, up=3, down=6, - absolute=True, relative=True) - self.assertEqual(d3.right(), -d3.left()) - self.assertEqual(d3.left(), -d3.right()) - self.assertEqual(d3.up(), -d3.down()) - self.assertEqual(d3.down(), -d3.up()) - self.assertEqual(d3.absolute(), not d3.relative()) - self.assertEqual(d3.relative(), not d3.absolute()) - - def test_copy(self): - d = Direction(right=5) - c = d.copy() - self.assertEqual(c.right(), d.right()) - d['right'] += 3 - self.assertNotEqual(c.right(), d.right()) - c['right'] += 3 - self.assertEqual(c.right(), d.right()) - - self.assertFalse(d.vertical()) - self.assertTrue(d.horizontal()) - -# Doesn't work in python2? -# def test_duck_typing(self): -# dct = dict(right=7, down=-3) -# self.assertEqual(-7, Direction.left(dct)) -# self.assertEqual(3, Direction.up(dct)) - - def test_move(self): - d = Direction(pages=True) - self.assertEqual(3, d.move(direction=3)) - self.assertEqual(5, d.move(direction=3, current=2)) - self.assertEqual(15, d.move(direction=3, pagesize=5)) - self.assertEqual(9, d.move(direction=3, pagesize=5, maximum=10)) - self.assertEqual(18, d.move(direction=9, override=2)) - d2 = Direction(absolute=True) - self.assertEqual(5, d2.move(direction=9, override=5)) - - def test_select(self): - d = Direction(down=3) - lst = list(range(100)) - self.assertEqual((6, [3,4,5,6]), d.select(current=3, pagesize=10, override=None, lst=lst)) - d = Direction(down=3, pages=True) - self.assertEqual((9, [3,4,5,6,7,8,9]), d.select(current=3, pagesize=2, override=None, lst=lst)) - -if __name__ == '__main__': - unittest.main() - diff --git a/test/tc_directory.py b/test/tc_directory.py deleted file mode 100644 index a43ac89d..00000000 --- a/test/tc_directory.py +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -from os.path import realpath, join, dirname - -from ranger import fsobject -from ranger.fsobject.file import File -from ranger.fsobject.directory import Directory -from ranger.core.shared import SettingsAware - -SettingsAware._setup() - -TESTDIR = realpath(join(dirname(__file__), 'testdir')) -TESTFILE = join(TESTDIR, 'testfile5234148') -NONEXISTANT_DIR = join(TESTDIR, 'nonexistant') - -import unittest -class Test1(unittest.TestCase): - def test_initial_condition(self): - # Check for the expected initial condition - dir = Directory(TESTDIR) - - self.assertEqual(dir.path, TESTDIR) - self.assertFalse(dir.content_loaded) - self.assertEqual(dir.filenames, None) - self.assertEqual(dir.files, None) - if not sys.flags.optimize: # asserts are ignored with python -O - self.assertRaises(AssertionError, len, dir) - - def test_after_content_loaded(self): - import os - # Check whether the directory has the correct list of filenames. - dir = Directory(TESTDIR) - dir.load_content(schedule=False) - - self.assertTrue(dir.exists) - self.assertEqual(type(dir.filenames), list) - - # Get the filenames you expect it to have and sort both before - # comparing. I don't expect any order after only loading the filenames. - assumed_filenames = os.listdir(TESTDIR) - assumed_filenames = list(map(lambda str: os.path.join(TESTDIR, str), - assumed_filenames)) - assumed_filenames.sort() - dir.filenames.sort() - - self.assertTrue(len(dir) > 0) - self.assertEqual(dir.filenames, assumed_filenames) - - # build a file object for each file in the list assumed_filenames - # and find exactly one equivalent in dir.files - for name in assumed_filenames: - f = File(name) - f.load() - for dirfile in dir.files: - if (f.path == dirfile.path and f.stat == dirfile.stat): - break - else: - self.fail("couldn't find file {0}".format(name)) - - def test_nonexistant_dir(self): - dir = Directory(NONEXISTANT_DIR) - dir.load_content(schedule=False) - - self.assertTrue(dir.content_loaded) - self.assertFalse(dir.exists) - self.assertFalse(dir.accessible) - self.assertEqual(dir.filenames, None) - if not sys.flags.optimize: # asserts are ignored with python -O - self.assertRaises(AssertionError, len, dir) - - def test_load_if_outdated(self): - import os - import time - # modify the directory. If the time between the last modification - # was within the filesystems resolution of mtime, we should have a reload - - def modify_dir(): - open(TESTFILE, 'w').close() - os.unlink(TESTFILE) - - def mtime(): - return os.stat(TESTDIR).st_mtime - - dir = Directory(TESTDIR) - dir.load() - - # If the modification happens to be in the same second as the - # last modification, it will result in mtime having the same - # integer value. So we wait until the resolution is exceeded - # and mtime differs. - old_mtime = mtime() - for i in range(50): - modify_dir() - if old_mtime != mtime(): break - time.sleep(0.1) - else: - # fail after 5 seconds of trying - self.fail( - "Cannot perform test: mtime of TESTDIR is not being updated.") - - self.assertTrue(dir.load_if_outdated()) - -if __name__ == '__main__': - unittest.main() - diff --git a/test/tc_displayable.py b/test/tc_displayable.py deleted file mode 100644 index 72e0507d..00000000 --- a/test/tc_displayable.py +++ /dev/null @@ -1,167 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -import curses -from random import randint - -from ranger.gui.displayable import Displayable, DisplayableContainer -from testlib import Fake, OK, raise_ok, TODO - -class TestWithFakeCurses(unittest.TestCase): - def setUp(self): - self.win = Fake() - self.fm = Fake() - self.env = Fake() - self.settings = Fake() - self.initdict = {'win': self.win, 'settings': self.settings, - 'fm': self.fm, 'env': self.env} - - self.disp = Displayable(**self.initdict) - self.disc = DisplayableContainer(**self.initdict) - self.disc.add_child(self.disp) - - hei, wid = 100, 100 - self.env.termsize = (hei, wid) - - def tearDown(self): - self.disp.destroy() - self.disc.destroy() - - def test_colorscheme(self): - # Using a color method implies change of window attributes - disp = self.disp - - disp.win.chgat = raise_ok - disp.win.attrset = raise_ok - - self.assertRaises(OK, disp.color, 'a', 'b') - self.assertRaises(OK, disp.color_at, 0, 0, 0, 'a', 'b') - self.assertRaises(OK, disp.color_reset) - - def test_focused_object(self): - d1 = Displayable(**self.initdict) - d2 = DisplayableContainer(**self.initdict) - for obj in (Displayable(**self.initdict) for x in range(5)): - d2.add_child(obj) - d3 = DisplayableContainer(**self.initdict) - for obj in (Displayable(**self.initdict) for x in range(5)): - d3.add_child(obj) - - for obj in (d1, d2, d3): - self.disc.add_child(obj) - - d3.container[3].focused = True - - self.assertEqual(self.disc._get_focused_obj(), d3.container[3]) - - d3.container[3].focused = False - d2.container[0].focused = True - - self.assertEqual(self.disc._get_focused_obj(), d2.container[0]) - -gWin = None - -class TestDisplayableWithCurses(unittest.TestCase): - def setUp(self): - global gWin - if not gWin: - gWin = curses.initscr() - self.win = gWin - curses.cbreak() - curses.noecho() - curses.start_color() - curses.use_default_colors() - - self.fm = Fake() - self.env = Fake() - self.settings = Fake() - self.initdict = {'win': self.win, 'settings': self.settings, - 'fm': self.fm, 'env': self.env} - self.disp = Displayable(**self.initdict) - self.disc = DisplayableContainer(**self.initdict) - self.disc.add_child(self.disp) - - self.env.termsize = self.win.getmaxyx() - - def tearDown(self): - self.disp.destroy() - curses.nocbreak() - curses.echo() - curses.endwin() - - @TODO - def test_boundaries(self): - disp = self.disp - hei, wid = self.env.termsize - - self.assertRaises(ValueError, disp.resize, 0, 0, hei + 1, wid) - self.assertRaises(ValueError, disp.resize, 0, 0, hei, wid + 1) - self.assertRaises(ValueError, disp.resize, -1, 0, hei, wid) - self.assertRaises(ValueError, disp.resize, 0, -1, hei, wid) - - for i in range(1000): - box = [int(randint(0, hei) * 0.2), int(randint(0, wid) * 0.2)] - box.append(randint(0, hei - box[0])) - box.append(randint(0, wid - box[1])) - - def in_box(y, x): - return (y >= box[1] and y < box[1] + box[3]) and \ - (x >= box[0] and x < box[0] + box[2]) - - disp.resize(*box) - self.assertEqual(box, [disp.y, disp.x, disp.hei, disp.wid], - "Resizing failed for some reason on loop " + str(i)) - - for y, x in zip(range(10), range(10)): - is_in_box = in_box(y, x) - - point1 = (y, x) - self.assertEqual(is_in_box, point1 in disp) - - point2 = Fake() - point2.x = x - point2.y = y - self.assertEqual(is_in_box, point2 in disp) - - def test_click(self): - self.disp.click = raise_ok - - hei, wid = self.env.termsize - - for i in range(50): - winwid = randint(2, wid-1) - winhei = randint(2, hei-1) - self.disc.resize(0, 0, hei, wid) - self.disp.resize(0, 0, winhei, winwid) - fakepos = Fake() - - fakepos.x = winwid - 2 - fakepos.y = winhei - 2 - self.assertRaises(OK, self.disc.click, fakepos) - - fakepos.x = winwid - fakepos.y = winhei - self.disc.click(fakepos) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_ext.py b/test/tc_ext.py deleted file mode 100644 index 495591a1..00000000 --- a/test/tc_ext.py +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -from collections import deque - -from ranger.ext.iter_tools import * - -class TestCases(unittest.TestCase): - def test_flatten(self): - def f(x): - return list(flatten(x)) - - self.assertEqual( - [1,2,3,4,5], - f([1,2,3,4,5])) - self.assertEqual( - [1,2,3,4,5], - f([1,[2,3],4,5])) - self.assertEqual( - [1,2,3,4,5], - f([[1,[2,3]],4,5])) - self.assertEqual( - [], - f([[[[]]]])) - self.assertEqual( - ['a', 'b', 'fskldfjl'], - f(['a', ('b', 'fskldfjl')])) - self.assertEqual( - ['a', 'b', 'fskldfjl'], - f(['a', deque(['b', 'fskldfjl'])])) - self.assertEqual( - set([3.5, 4.3, 5.2, 6.0]), - set(f([6.0, set((3.5, 4.3)), (5.2, )]))) - - def test_unique(self): - def u(x): - return list(unique(x)) - - self.assertEqual( - [1,2,3], - u([1,2,3])) - self.assertEqual( - [1,2,3], - u([1,2,3,2,1])) - self.assertEqual( - [1,2,3], - u([1,2,3,1,2,3,2,2,3,1,2,3,1,2,3,2,3,2,1])) - self.assertEqual( - [1,[2,3]], - u([1,[2,3],1,[2,3],[2,3],1,[2,3],1,[2,3],[2,3],1])) - - def test_unique_keeps_type(self): - def u(x): - return unique(x) - - self.assertEqual( - [1,2,3], - u([1,2,3,1])) - self.assertEqual( - (1,2,3), - u((1,2,3,1))) - self.assertEqual( - set((1,2,3)), - u(set((1,2,3,1)))) - self.assertEqual( - deque((1,2,3)), - u(deque((1,2,3,1)))) - - def test_mount_path(self): - # assuming ismount() is used - - def my_ismount(path): - depth = path.count('/') - if path.startswith('/media'): - return depth == 0 or depth == 2 - return depth <= 1 - - from ranger.ext import mount_path - original_ismount = mount_path.ismount - mount_path.ismount = my_ismount - try: - mp = mount_path.mount_path - - self.assertEqual('/home', mp('/home/hut/porn/bondage')) - self.assertEqual('/', mp('/')) - self.assertEqual('/media/sdb1', mp('/media/sdb1/foo/bar')) - self.assertEqual('/media/sdc2', mp('/media/sdc2/a/b/c/d/e')) - finally: - mount_path.ismount = original_ismount - - # TODO: links are not tested but I don't see how its possible - # without messing around with mounts. - # self.assertEqual('/media/foo', - # mount_path('/media/bar/some_link_to_a_foo_subdirectory')) - - def test_openstruct(self): - from ranger.ext.openstruct import OpenStruct - from random import randint, choice - from string import ascii_letters - - os = OpenStruct(a='a') - self.assertEqual(os.a, 'a') - self.assertRaises(AttributeError, getattr, os, 'b') - - dictionary = {'foo': 'bar', 'zoo': 'zar'} - os = OpenStruct(dictionary) - self.assertEqual(os.foo, 'bar') - self.assertEqual(os.zoo, 'zar') - self.assertRaises(AttributeError, getattr, os, 'sdklfj') - - for i in range(100): - attr_name = ''.join(choice(ascii_letters) \ - for x in range(randint(3,9))) - value = randint(100,999) - if not attr_name in os: - self.assertRaises(AttributeError, getattr, os, attr_name) - setattr(os, attr_name, value) - value2 = randint(100,999) - setattr(os, attr_name, value2) - self.assertEqual(value2, getattr(os, attr_name)) - - def test_shell_escape(self): - from ranger.ext.shell_escape import shell_escape, shell_quote - self.assertEqual(r"'luigi'\''s pizza'", shell_quote("luigi's pizza")) - self.assertEqual(r"luigi\'s\ pizza", shell_escape("luigi's pizza")) - self.assertEqual(r"\$lol/foo\\xyz\|\>\<\]\[", - shell_escape(r"$lol/foo\xyz|><][")) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_history.py b/test/tc_history.py deleted file mode 100644 index 02a8bb9f..00000000 --- a/test/tc_history.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -from ranger.container import History -from unittest import TestCase, main -import unittest - -class Test(TestCase): - def test_history(self): - hist = History(3) - for i in range(6): - hist.add(i) - self.assertEqual([3,4,5], list(hist)) - - hist.back() - - self.assertEqual(4, hist.current()) - self.assertEqual([3,4], list(hist._left())) - - self.assertEqual(5, hist.top()) - - hist.back() - self.assertEqual(3, hist.current()) - self.assertEqual([3], list(hist._left())) - - # no change if current == bottom - self.assertEqual(hist.current(), hist.bottom()) - last = hist.current() - hist.back() - self.assertEqual(hist.current(), last) - - self.assertEqual(5, hist.top()) - - hist.forward() - hist.forward() - self.assertEqual(5, hist.current()) - self.assertEqual([3,4,5], list(hist._left())) - - - self.assertEqual(3, hist.bottom()) - hist.add(6) - self.assertEqual(4, hist.bottom()) - self.assertEqual([4,5,6], list(hist._left())) - - hist.back() - hist.fast_forward() - self.assertEqual([4,5,6], list(hist._left())) - hist.back() - hist.back() - hist.fast_forward() - self.assertEqual([4,5,6], list(hist._left())) - hist.back() - hist.back() - hist.back() - hist.fast_forward() - self.assertEqual([4,5,6], list(hist._left())) - hist.back() - hist.back() - hist.back() - hist.back() - hist.fast_forward() - self.assertEqual([4,5,6], list(hist._left())) - -if __name__ == '__main__': main() diff --git a/test/tc_human_readable.py b/test/tc_human_readable.py deleted file mode 100644 index 493e6d3a..00000000 --- a/test/tc_human_readable.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -from ranger.ext.human_readable import human_readable as hr - -class HumanReadableTest(unittest.TestCase): - def test_basic(self): - self.assertEqual("0", hr(0)) - self.assertEqual("1 B", hr(1)) - self.assertEqual("1 K", hr(2 ** 10)) - self.assertEqual("1 M", hr(2 ** 20)) - self.assertEqual("1 G", hr(2 ** 30)) - self.assertEqual(">9000", hr(2 ** 100)) - - def test_big(self): - self.assertEqual("1023 G", hr(2 ** 30 * 1023)) - self.assertEqual("1024 G", hr(2 ** 40 - 1)) - self.assertEqual("1 T", hr(2 ** 40)) - - def test_small(self): - self.assertEqual("1000 B", hr(1000)) - self.assertEqual("1.66 M", hr(1.66 * 2 ** 20)) - self.assertEqual("1.46 K", hr(1500)) - self.assertEqual("1.5 K", hr(2 ** 10 + 2 ** 9)) - self.assertEqual("1.5 K", hr(2 ** 10 + 2 ** 9 - 1)) - - def test_no_exponent(self): - for i in range(2 ** 10, 2 ** 20, 512): - self.assertTrue('e' not in hr(i), "%d => %s" % (i, hr(i))) - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_keyapi.py b/test/tc_keyapi.py deleted file mode 100644 index 79d89fa5..00000000 --- a/test/tc_keyapi.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -from unittest import TestCase, main - -class Test(TestCase): - def test_wrapper(self): - from ranger.api.keys import Wrapper - - class dummyfm(object): - def move(self, relative): - return "I move down by {0}".format(relative) - - class commandarg(object): - def __init__(self): - self.fm = dummyfm() - self.n = None - self.direction = None - - arg = commandarg() - - do = Wrapper('fm') - command = do.move(relative=4) - - self.assertEqual(command(arg), 'I move down by 4') - -if __name__ == '__main__': main() diff --git a/test/tc_loader.py b/test/tc_loader.py deleted file mode 100644 index a679a629..00000000 --- a/test/tc_loader.py +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -import os -from os.path import realpath, join, dirname - -from testlib import Fake -from ranger.core.shared import FileManagerAware, SettingsAware -from ranger.core.loader import Loader -from ranger.fsobject import Directory, File -from ranger.ext.openstruct import OpenStruct - -TESTDIR = realpath(join(dirname(__file__), 'testdir')) -#TESTDIR = "/usr/sbin" - -class Test1(unittest.TestCase): - def test_loader(self): - loader = Loader() - fm = OpenStruct(loader=loader) - SettingsAware.settings = Fake() - FileManagerAware.fm = fm - - # initially, the loader has nothing to do - self.assertFalse(loader.has_work()) - - dir = Directory(TESTDIR) - self.assertEqual(None, dir.files) - self.assertFalse(loader.has_work()) - - # Calling load_content() will enqueue the loading operation. - # dir is not loaded yet, but the loader has work - dir.load_content(schedule=True) - self.assertEqual(None, dir.files) - self.assertTrue(loader.has_work()) - - iterations = 0 - while loader.has_work(): - iterations += 1 - loader.work() - #print(iterations) - self.assertNotEqual(None, dir.files) - self.assertFalse(loader.has_work()) -# -# def test_get_overhead_of_loader(self): -# N = 5 -# tloader = benchmark_load(N) -# traw = benchmark_raw_load(N) -# #traw1k = 250.0 -# #traw = traw1k * N / 1000.0 -# #print("Loader: {0}s".format(tloader)) -# #print("Raw: {0}s".format(traw)) -# self.assertTrue(tloader > traw) -# overhead = tloader * 100 / traw - 100 -# self.assertTrue(overhead < 2, "overhead of loader too high: {0}" \ -# .format(overhead)) -# #print("Overhead: {0:.5}%".format(overhead)) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_newkeys.py b/test/tc_newkeys.py deleted file mode 100644 index c9597201..00000000 --- a/test/tc_newkeys.py +++ /dev/null @@ -1,620 +0,0 @@ -# coding=utf-8 -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] -sys.path[1:1] = ['..'] - -from unittest import TestCase, main - -from testlib import TODO -from ranger.ext.tree import Tree -from ranger.container.keymap import * -from ranger.container.keybuffer import KeyBuffer -from ranger.ext.keybinding_parser import parse_keybinding - -def simulate_press(self, string): - for char in parse_keybinding(string): - self.add(char) - if self.done: - return self.command - if self.failure: - break - return self.command - -class PressTestCase(TestCase): - """Some useful methods for the actual test""" - def _mkpress(self, keybuffer, _=0): - def press(keys): - keybuffer.clear() - match = simulate_press(keybuffer, keys) - self.assertFalse(keybuffer.failure, - "parsing keys '"+keys+"' did fail!") - self.assertTrue(keybuffer.done, - "parsing keys '"+keys+"' did not complete!") - arg = CommandArgs(None, None, keybuffer) - self.assert_(match.function, "No function found! " + \ - str(match.__dict__)) - return match.function(arg) - return press - - def assertPressFails(self, kb, keys): - kb.clear() - simulate_press(kb, keys) - self.assertTrue(kb.failure, "Keypress did not fail as expected") - kb.clear() - - def assertPressIncomplete(self, kb, keys): - kb.clear() - simulate_press(kb, keys) - self.assertFalse(kb.failure, "Keypress failed, expected incomplete") - self.assertFalse(kb.done, "Keypress done which was unexpected") - kb.clear() - -class Test(PressTestCase): - """The test cases""" - def test_passive_action(self): - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - def n(value): - """return n or value""" - def fnc(arg=None): - if arg is None or arg.n is None: - return value - return arg.n - return fnc - - km.map('ppp', n(5)) - km.map('pp', n(8)) - km.map('pp', n(2)) - directions.map('j', dir=Direction(down=1)) - - press = self._mkpress(kb, km) - self.assertEqual(5, press('ppp')) - self.assertEqual(3, press('3ppp')) - - self.assertEqual(2, press('ppj')) - - kb.clear() - match = simulate_press(kb, 'pp') - args = CommandArgs(0, 0, kb) - self.assert_(match) - self.assert_(match.function) - self.assertEqual(8, match.function(args)) - - def test_translate_keys(self): - def test(string, *args): - if not args: - args = (string, ) - self.assertEqual(ordtuple(*args), tuple(parse_keybinding(string))) - - def ordtuple(*args): - lst = [] - for arg in args: - if isinstance(arg, str): - lst.extend(ord(c) for c in arg) - else: - lst.append(arg) - return tuple(lst) - - # 1 argument means: assume nothing is translated. - test('k') - test('kj') - test('k', 'k', DIRKEY) - test('kz', 'k', ANYKEY, 'z', ANYKEY) - test('kz', 'k', ANYKEY, 'z', DIRKEY) - test('', "\n") - test('', "\t\t\n") - test('<') - test('>') - test('', 1) - test('', 2) - for i in range(1, 26): - test('', i) - test('', 27, ord('x')) - test('', 27, ord('o')) - test('k') - test('k') - test('k') - test('knz>') - test('>nz>') - - def test_alias(self): - def add_dirs(arg): - return sum(dir.down() for dir in arg.directions) - def return5(_): - return 5 - - directions = KeyMap() - directions.map('j', dir=Direction(down=1)) - directions.map('k', dir=Direction(down=-1)) - directions.map('', alias='j') - directions.map('@', alias='') - - base = KeyMap() - base.map('a', add_dirs) - base.map('b', add_dirs) - base.map('xx', add_dirs) - base.map('f', return5) - base.map('yy', alias='y') - base.map('!', alias='!') - - other = KeyMap() - other.map('bb', alias='xx') - other.map('c', add_dirs) - other.map('g', alias='f') - - km = base.merge(other, copy=True) - kb = KeyBuffer(km, directions) - - press = self._mkpress(kb, km) - - self.assertEqual(1, press('aj')) - self.assertEqual(2, press('bjbj')) - self.assertEqual(1, press('cj')) - self.assertEqual(1, press('c')) - - self.assertEqual(5, press('f')) - self.assertEqual(5, press('g')) - self.assertEqual(press('c'), press('c@')) - self.assertEqual(press('c'), press('c@')) - self.assertEqual(press('c'), press('c@')) - - for n in range(1, 10): - self.assertPressIncomplete(kb, 'y' * n) - - for n in range(1, 5): - self.assertPressFails(kb, '!' * n) - - def test_tree(self): - t = Tree() - t.set('abcd', "Yes") - self.assertEqual("Yes", t.traverse('abcd')) - self.assertRaises(KeyError, t.traverse, 'abcde') - self.assertRaises(KeyError, t.traverse, 'xyz') - self.assert_(isinstance(t.traverse('abc'), Tree)) - - t2 = Tree() - self.assertRaises(KeyError, t2.set, 'axy', "Lol", force=False) - t2.set('axx', 'ololol') - t2.set('axyy', "Lol") - self.assertEqual("Yes", t.traverse('abcd')) - self.assertRaises(KeyError, t2.traverse, 'abcd') - self.assertEqual("Lol", t2.traverse('axyy')) - self.assertEqual("ololol", t2.traverse('axx')) - - t2.unset('axyy') - self.assertEqual("ololol", t2.traverse('axx')) - self.assertRaises(KeyError, t2.traverse, 'axyy') - self.assertRaises(KeyError, t2.traverse, 'axy') - - t2.unset('a') - self.assertRaises(KeyError, t2.traverse, 'abcd') - self.assertRaises(KeyError, t2.traverse, 'a') - self.assert_(t2.empty()) - - def test_merge_trees(self): - def makeTreeA(): - t = Tree() - t.set('aaaX', 1) - t.set('aaaY', 2) - t.set('aaaZ', 3) - t.set('bbbA', 11) - t.set('bbbB', 12) - t.set('bbbC', 13) - t.set('bbbD', 14) - t.set('bP', 21) - t.set('bQ', 22) - return t - - def makeTreeB(): - u = Tree() - u.set('aaaX', 0) - u.set('bbbC', 'Yes') - u.set('bbbD', None) - u.set('bbbE', 15) - u.set('bbbF', 16) - u.set('bQ', 22) - u.set('bR', 23) - u.set('ffff', 1337) - return u - - # test 1 - t = Tree('a') - u = Tree('b') - merged = t.merge(u, copy=True) - self.assertEqual('b', merged._tree) - - # test 2 - t = Tree('a') - u = makeTreeA() - merged = t.merge(u, copy=True) - self.assertEqual(u._tree, merged._tree) - - # test 3 - t = makeTreeA() - u = makeTreeB() - v = t.merge(u, copy=True) - - self.assertEqual(0, v['aaaX']) - self.assertEqual(2, v['aaaY']) - self.assertEqual(3, v['aaaZ']) - self.assertEqual(11, v['bbbA']) - self.assertEqual('Yes', v['bbbC']) - self.assertEqual(None, v['bbbD']) - self.assertEqual(15, v['bbbE']) - self.assertEqual(16, v['bbbF']) - self.assertRaises(KeyError, t.__getitem__, 'bbbG') - self.assertEqual(21, v['bP']) - self.assertEqual(22, v['bQ']) - self.assertEqual(23, v['bR']) - self.assertEqual(1337, v['ffff']) - - # merge shouldn't be destructive - self.assertEqual(makeTreeA()._tree, t._tree) - self.assertEqual(makeTreeB()._tree, u._tree) - - v['fff'].replace('Lolz') - self.assertEqual('Lolz', v['fff']) - - v['aaa'].replace('Very bad') - v.plow('qqqqqqq').replace('eww.') - - self.assertEqual(makeTreeA()._tree, t._tree) - self.assertEqual(makeTreeB()._tree, u._tree) - - def test_add(self): - c = KeyMap() - c.map('aa', 'b', lambda *_: 'lolz') - self.assert_(c['aa'].function(), 'lolz') - @c.map('a', 'c') - def test(): - return 5 - self.assert_(c['b'].function(), 'lolz') - self.assert_(c['c'].function(), 5) - self.assert_(c['a'].function(), 5) - - def test_quantifier(self): - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - def n(value): - """return n or value""" - def fnc(arg=None): - if arg is None or arg.n is None: - return value - return arg.n - return fnc - km.map('p', n(5)) - press = self._mkpress(kb, km) - self.assertEqual(5, press('p')) - self.assertEqual(3, press('3p')) - self.assertEqual(6223, press('6223p')) - - def test_direction(self): - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - directions.map('j', dir=Direction(down=1)) - directions.map('k', dir=Direction(down=-1)) - def nd(arg): - """ n * direction """ - n = arg.n is None and 1 or arg.n - dir = arg.direction is None and Direction(down=1) \ - or arg.direction - return n * dir.down() - km.map('d', nd) - km.map('dd', func=nd) - - press = self._mkpress(kb, km) - - self.assertPressIncomplete(kb, 'd') - self.assertEqual( 1, press('dj')) - self.assertEqual( 3, press('3ddj')) - self.assertEqual( 15, press('3d5j')) - self.assertEqual(-15, press('3d5k')) - # supporting this kind of key combination would be too confusing: - # self.assertEqual( 15, press('3d5d')) - self.assertEqual( 3, press('3dd')) - self.assertEqual( 33, press('33dd')) - self.assertEqual( 1, press('dd')) - - km.map('x', nd) - km.map('xxxx', func=nd) - - self.assertEqual(1, press('xxxxj')) - self.assertEqual(1, press('xxxxjsomeinvalitchars')) - - # these combinations should break: - self.assertPressFails(kb, 'xxxj') - self.assertPressFails(kb, 'xxj') - self.assertPressFails(kb, 'xxkldfjalksdjklsfsldkj') - self.assertPressFails(kb, 'xyj') - self.assertPressIncomplete(kb, 'x') # direction missing - - def test_any_key(self): - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - directions.map('j', dir=Direction(down=1)) - directions.map('k', dir=Direction(down=-1)) - - directions.map('g', dir=Direction(down=-1)) - - def cat(arg): - n = arg.n is None and 1 or arg.n - return ''.join(chr(c) for c in arg.matches) * n - - km.map('return', cat) - km.map('cat4', cat) - km.map('foo', cat) - - press = self._mkpress(kb, km) - - self.assertEqual('x', press('returnx')) - self.assertEqual('abcd', press('cat4abcd')) - self.assertEqual('abcdabcd', press('2cat4abcd')) - self.assertEqual('55555', press('5return5')) - - self.assertEqual('x', press('foojx')) - self.assertPressFails(kb, 'fooggx') # ANYKEY forbidden in DIRECTION - - km.map('', lambda _: Ellipsis) - self.assertEqual('x', press('returnx')) - self.assertEqual('abcd', press('cat4abcd')) - self.assertEqual(Ellipsis, press('2cat4abcd')) - self.assertEqual(Ellipsis, press('5return5')) - self.assertEqual(Ellipsis, press('g')) - self.assertEqual(Ellipsis, press('ß')) - self.assertEqual(Ellipsis, press('ア')) - self.assertEqual(Ellipsis, press('9')) - - def test_multiple_directions(self): - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - directions.map('j', dir=Direction(down=1)) - directions.map('k', dir=Direction(down=-1)) - - def add_dirs(arg): - return sum(dir.down() for dir in arg.directions) - - km.map('xy', add_dirs) - km.map('four', add_dirs) - - press = self._mkpress(kb, km) - - self.assertEqual(2, press('xjyj')) - self.assertEqual(0, press('fourjkkj')) - self.assertEqual(2, press('four2j4k2j2j')) - self.assertEqual(10, press('four1j2j3j4j')) - self.assertEqual(10, press('four1j2j3j4jafslkdfjkldj')) - - def test_corruptions(self): - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - press = self._mkpress(kb, km) - directions.map('j', dir=Direction(down=1)) - directions.map('k', dir=Direction(down=-1)) - km.map('xxx', lambda _: 1) - - self.assertEqual(1, press('xxx')) - - # corrupt the tree - tup = tuple(parse_keybinding('xxx')) - x = ord('x') - km._tree[x][x][x] = "Boo" - - self.assertPressFails(kb, 'xxy') - self.assertPressFails(kb, 'xzy') - self.assertPressIncomplete(kb, 'xx') - self.assertPressIncomplete(kb, 'x') - if not sys.flags.optimize: # asserts are ignored with python -O - self.assertRaises(AssertionError, simulate_press, kb, 'xxx') - kb.clear() - - def test_directions_as_functions(self): - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - press = self._mkpress(kb, km) - - def move(arg): - return arg.direction.down() - - directions.map('j', dir=Direction(down=1)) - directions.map('s', alias='j') - directions.map('k', dir=Direction(down=-1)) - km.map('', func=move) - - self.assertEqual(1, press('j')) - self.assertEqual(1, press('j')) - self.assertEqual(1, press('j')) - self.assertEqual(1, press('j')) - self.assertEqual(1, press('j')) - self.assertEqual(1, press('s')) - self.assertEqual(1, press('s')) - self.assertEqual(1, press('s')) - self.assertEqual(1, press('s')) - self.assertEqual(1, press('s')) - self.assertEqual(-1, press('k')) - self.assertEqual(-1, press('k')) - self.assertEqual(-1, press('k')) - - km.map('k', func=lambda _: 'love') - - self.assertEqual(1, press('j')) - self.assertEqual('love', press('k')) - - self.assertEqual(1, press('40j')) - self.assertEqual(40, kb.quant) - - km.map('', func=move) - - self.assertEqual(1, press('40jkhl')) - self.assertEqual(40, kb.quant) - - def test_tree_deep_copy(self): - t = Tree() - s = t.plow('abcd') - s.replace('X') - u = t.copy() - self.assertEqual(t._tree, u._tree) - s = t.traverse('abc') - s.replace('Y') - self.assertNotEqual(t._tree, u._tree) - - def test_keymanager(self): - def func(arg): - return 5 - def getdown(arg): - return arg.direction.down() - - buffer = KeyBuffer(None, None) - press = self._mkpress(buffer) - keymanager = KeyManager(buffer, ['foo', 'bar']) - - map = keymanager.get_context('foo') - map('a', func) - map('b', func) - map = keymanager.get_context('bar') - map('c', func) - map('', getdown) - - keymanager.dir('foo', 'j', down=1) - keymanager.dir('bar', 'j', down=1) - - keymanager.use_context('foo') - self.assertEqual(5, press('a')) - self.assertEqual(5, press('b')) - self.assertPressFails(buffer, 'c') - - keymanager.use_context('bar') - self.assertPressFails(buffer, 'a') - self.assertPressFails(buffer, 'b') - self.assertEqual(5, press('c')) - self.assertEqual(1, press('j')) - keymanager.use_context('foo') - keymanager.use_context('foo') - keymanager.use_context('foo') - keymanager.use_context('bar') - keymanager.use_context('foo') - keymanager.use_context('bar') - keymanager.use_context('bar') - self.assertEqual(1, press('j')) - - def test_alias_to_direction(self): - def func(arg): - return arg.direction.down() - - km = KeyMapWithDirections() - kb = KeyBuffer(km, km.directions) - press = self._mkpress(kb) - - km.map('', func) - km.map('d', func) - km.dir('j', down=42) - km.dir('k', alias='j') - self.assertEqual(42, press('j')) - - km.dir('o', alias='j') - km.dir('ick', alias='j') - self.assertEqual(42, press('o')) - self.assertEqual(42, press('dj')) - self.assertEqual(42, press('dk')) - self.assertEqual(42, press('do')) - self.assertEqual(42, press('dick')) - self.assertPressFails(kb, 'dioo') - - def test_both_directory_and_any_key(self): - def func(arg): - return arg.direction.down() - def func2(arg): - return "yay" - - km = KeyMap() - directions = KeyMap() - kb = KeyBuffer(km, directions) - press = self._mkpress(kb) - - km.map('abc', func) - directions.map('j', dir=Direction(down=42)) - self.assertEqual(42, press('abcj')) - - km.unmap('abc') - - km.map('abc', func2) - self.assertEqual("yay", press('abcd')) - - km.map('abc', func) - - km.map('abc', func2) - self.assertEqual("yay", press('abcd')) - - def test_map_collision(self): - def add_dirs(arg): - return sum(dir.down() for dir in arg.directions) - def return5(_): - return 5 - - - directions = KeyMap() - directions.map('gg', dir=Direction(down=1)) - - - km = KeyMap() - km.map('gh', return5) - km.map('agh', return5) - km.map('a', add_dirs) - - kb = KeyBuffer(km, directions) - press = self._mkpress(kb, km) - - self.assertEqual(5, press('gh')) - self.assertEqual(5, press('agh')) -# self.assertPressFails(kb, 'agh') - - @TODO - def test_map_collision2(self): - directions = KeyMap() - directions.map('gg', dir=Direction(down=1)) - km = KeyMap() - km.map('agh', lambda _: 1) - km.map('a', lambda _: 2) - kb = KeyBuffer(km, directions) - press = self._mkpress(kb, km) - self.assertEqual(1, press('agh')) - self.assertEqual(2, press('agg')) - - def test_keymap_with_dir(self): - def func(arg): - return arg.direction.down() - - km = KeyMapWithDirections() - kb = KeyBuffer(km, km.directions) - - press = self._mkpress(kb) - - km.map('abc', func) - km.dir('j', down=42) - self.assertEqual(42, press('abcj')) - -if __name__ == '__main__': main() diff --git a/test/tc_relative_symlink.py b/test/tc_relative_symlink.py deleted file mode 100644 index a202513d..00000000 --- a/test/tc_relative_symlink.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -from ranger.ext.relative_symlink import * -rel = get_relative_source_file - -class Test(unittest.TestCase): - def test_foo(self): - self.assertEqual('../foo', rel('/foo', '/x/bar')) - self.assertEqual('../../foo', rel('/foo', '/x/y/bar')) - self.assertEqual('../../a/b/foo', rel('/a/b/foo', '/x/y/bar')) - self.assertEqual('../../x/b/foo', rel('/x/b/foo', '/x/y/bar', - common_base='/')) - self.assertEqual('../b/foo', rel('/x/b/foo', '/x/y/bar')) - self.assertEqual('../b/foo', rel('/x/b/foo', '/x/y/bar')) - - def test_get_common_base(self): - self.assertEqual('/', get_common_base('', '')) - self.assertEqual('/', get_common_base('', '/')) - self.assertEqual('/', get_common_base('/', '')) - self.assertEqual('/', get_common_base('/', '/')) - self.assertEqual('/', get_common_base('/bla/bar/x', '/foo/bar/a')) - self.assertEqual('/foo/bar/', get_common_base('/foo/bar/x', '/foo/bar/a')) - self.assertEqual('/foo/', get_common_base('/foo/bar/x', '/foo/baz/a')) - self.assertEqual('/foo/', get_common_base('/foo/bar/x', '/foo/baz/a')) - self.assertEqual('/', get_common_base('//foo/bar/x', '/foo/baz/a')) - -if __name__ == '__main__': unittest.main() diff --git a/test/tc_signal.py b/test/tc_signal.py deleted file mode 100644 index 6547bbc3..00000000 --- a/test/tc_signal.py +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -import gc -from ranger.ext.signals import * - -class TestSignal(unittest.TestCase): - def setUp(self): - self.sd = SignalDispatcher() - - def test_signal_register_emit(self): - sd = self.sd - def poo(sig): - self.assert_('works' in sig) - self.assertEqual('yes', sig.works) - handler = sd.signal_bind('x', poo) - - sd.signal_emit('x', works='yes') - sd.signal_unbind(handler) - sd.signal_emit('x') - - def test_signal_order(self): - sd = self.sd - lst = [] - def addn(n): - return lambda _: lst.append(n) - - sd.signal_bind('x', addn(6)) - sd.signal_bind('x', addn(3), priority=1) - sd.signal_bind('x', addn(2), priority=1) - sd.signal_bind('x', addn(9), priority=0) - sd.signal_bind('x', addn(1337), priority=0.7) - sd.signal_emit('x') - - self.assert_(lst.index(3) < lst.index(6)) - self.assert_(lst.index(2) < lst.index(6)) - self.assert_(lst.index(6) < lst.index(9)) - self.assert_(lst.index(1337) < lst.index(6)) - self.assert_(lst.index(1337) < lst.index(9)) - self.assert_(lst.index(1337) > lst.index(2)) - - def test_modifying_arguments(self): - sd = self.sd - lst = [] - def modify(s): - s.number = 5 - def set_number(s): - lst.append(s.number) - def stopit(s): - s.stop() - - sd.signal_bind('setnumber', set_number) - sd.signal_emit('setnumber', number=100) - self.assertEqual(100, lst[-1]) - - sd.signal_bind('setnumber', modify, priority=1) - sd.signal_emit('setnumber', number=100) - self.assertEqual(5, lst[-1]) - - lst.append(None) - sd.signal_bind('setnumber', stopit, priority=1) - sd.signal_emit('setnumber', number=100) - self.assertEqual(None, lst[-1]) - - def test_weak_refs(self): - sd = self.sd - is_deleted = [False] - - class Foo(object): - def __init__(self): - self.alphabet = ['a'] - def calc(self, signal): - self.alphabet.append(chr(ord(self.alphabet[-1]) + 1)) - def __del__(self): - is_deleted[0] = True - - foo = Foo() - alphabet = foo.alphabet - calc = foo.calc - - del foo - self.assertEqual('a', ''.join(alphabet)) - sd.signal_bind('mysignal', calc, weak=True) - sd.signal_emit('mysignal') - self.assertEqual('ab', ''.join(alphabet)) - self.assertFalse(is_deleted[0]) - - del calc - self.assertTrue(is_deleted[0]) - - def test_weak_refs_dead_on_arrival(self): - sd = self.sd - is_deleted = [False] - - class Foo(object): - def __init__(self): - self.alphabet = ['a'] - def calc(self, signal): - self.alphabet.append(chr(ord(self.alphabet[-1]) + 1)) - def __del__(self): - is_deleted[0] = True - - foo = Foo() - alphabet = foo.alphabet - - self.assertEqual('a', ''.join(alphabet)) - sd.signal_bind('mysignal', foo.calc, weak=True) - - sd.signal_emit('mysignal') - self.assertEqual('ab', ''.join(alphabet)) - self.assertFalse(is_deleted[0]) - - del foo - - sd.signal_emit('mysignal') - self.assertEqual('ab', ''.join(alphabet)) - self.assertTrue(is_deleted[0]) - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_ui.py b/test/tc_ui.py deleted file mode 100644 index fa2bdcac..00000000 --- a/test/tc_ui.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] - -import unittest -import curses - -from ranger.gui import ui - -from testlib import Fake, OK, raise_ok - -ui.curses = Fake() - -class Test(unittest.TestCase): - def setUp(self): - - self.fm = Fake() - self.ui = ui.UI(env=Fake(), fm=self.fm) - - def fakesetup(): - self.ui.widget = Fake() - self.ui.add_child(self.ui.widget) - self.ui.setup = fakesetup - - self.ui.initialize() - - def tearDown(self): - self.ui.destroy() - - def test_passing(self): - # Test whether certain method calls are passed to widgets - widget = self.ui.widget - - widget.draw = raise_ok - self.assertRaises(OK, self.ui.draw) - widget.__clear__() - - widget.finalize = raise_ok - self.assertRaises(OK, self.ui.finalize) - widget.__clear__() - - widget.press = raise_ok - random_key = 123 - self.assertRaises(OK, self.ui.handle_key, random_key) - widget.__clear__() - - widget.destroy = raise_ok - self.assertRaises(OK, self.ui.destroy) - widget.__clear__() - -if __name__ == '__main__': - unittest.main() diff --git a/test/tc_utfwidth.py b/test/tc_utfwidth.py deleted file mode 100644 index 0288c17b..00000000 --- a/test/tc_utfwidth.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- encoding: utf8 -*- -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 - -import os.path -import sys -rangerpath = os.path.join(os.path.dirname(__file__), '..') -if sys.path[1] != rangerpath: - sys.path[1:1] = [rangerpath] -sys.path[1:1] = ['..'] - -from unittest import TestCase, main -from ranger.ext.utfwidth import * - -a_ascii = "a" # width = 1, bytes = 1 -a_umlaut = "ä" # width = 1, bytes = 2 -a_katakana = "ア" # width = 2, bytes = 3 -# need one with width = 1 & bytes = 3 - -class Test(TestCase): - def test_utf_byte_length(self): - self.assertEqual(1, utf_byte_length(a_ascii)) - self.assertEqual(2, utf_byte_length(a_umlaut)) - self.assertEqual(3, utf_byte_length(a_katakana)) - - def test_uwid(self): - self.assertEqual(1, uwid(a_ascii)) - self.assertEqual(1, uwid(a_umlaut)) - self.assertEqual(2, uwid(a_katakana)) - self.assertEqual(3, uwid(a_katakana + a_umlaut)) - self.assertEqual(4, uwid("asdf")) - self.assertEqual(5, uwid("löööl")) - self.assertEqual(6, uwid("バババ")) - -if __name__ == '__main__': main() diff --git a/test/testdir/largefile.txt b/test/testdir/largefile.txt deleted file mode 100644 index 0eb8c64f..00000000 --- a/test/testdir/largefile.txt +++ /dev/null @@ -1 +0,0 @@ -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX diff --git a/test/testdir/symlink b/test/testdir/symlink deleted file mode 120000 index 5cbc1596..00000000 --- a/test/testdir/symlink +++ /dev/null @@ -1 +0,0 @@ -textfile.txt \ No newline at end of file diff --git a/test/testdir/textfile.txt b/test/testdir/textfile.txt deleted file mode 100644 index 45a23497..00000000 --- a/test/testdir/textfile.txt +++ /dev/null @@ -1,4 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. -Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. -Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/test/testdir/zerobytes b/test/testdir/zerobytes deleted file mode 100644 index e69de29b..00000000 diff --git a/test/testlib.py b/test/testlib.py deleted file mode 100644 index 29dd9e07..00000000 --- a/test/testlib.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# 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 . - -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() -- cgit 1.4.1-2-gfad0 From a082b66a56cab3003964c1217e37f248b34dacc8 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 29 Sep 2011 04:24:27 +0200 Subject: updated Makefile --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 77fad740..6c5ed88c 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,8 @@ compile: clean PYTHONOPTIMIZE=$(PYOPTIMIZE) $(PYTHON) -m compileall -q ranger clean: - find . -regex .\*.py[co]\$$ -exec rm -f -- {} \; + find ranger -regex .\*.py[co]\$$ -delete + find ranger -depth -name __pycache__ -type d -exec rm -rf -- {} \; doc: cleandoc mkdir -p $(DOCDIR) -- cgit 1.4.1-2-gfad0 From c0d63e78e20428d27715e7afcb56e6711cfd9556 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 5 Oct 2011 13:43:41 +0200 Subject: Makefile: added "make todo" and added some notes in code --- Makefile | 5 ++++- ranger/api/commands.py | 1 + ranger/ext/command_parser.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6c5ed88c..30a92220 100644 --- a/Makefile +++ b/Makefile @@ -75,4 +75,7 @@ cleandoc: snapshot: git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME) -.PHONY: default options compile clean doc cleandoc snapshot install man +todo: + @grep --color -Ion '\(TODO\|XXX\).*' -r ranger + +.PHONY: default options compile clean doc cleandoc snapshot install man todo diff --git a/ranger/api/commands.py b/ranger/api/commands.py index 093e93da..ca8b5fad 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -141,6 +141,7 @@ class Command(FileManagerAware): def tabinsert(self, word): return ''.join([self._tabinsert_left, word, self._tabinsert_right]) + # XXX: Lazy properties? Not so smart? self.line can change after all! @lazy_property def _tabinsert_left(self): try: diff --git a/ranger/ext/command_parser.py b/ranger/ext/command_parser.py index 3b65067c..8bb72c76 100644 --- a/ranger/ext/command_parser.py +++ b/ranger/ext/command_parser.py @@ -16,6 +16,7 @@ import re SETTINGS_RE = re.compile(r'^([^\s]+?)=(.*)$') +# TODO: complete the merge of this into api/commands class LazyParser(object): """Parse commands and extract information""" def __init__(self, line): -- cgit 1.4.1-2-gfad0 From b0b3af33ec233f4f1d30c4e89da6668f98960ad8 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 5 Oct 2011 18:41:05 +0200 Subject: Makefile: update --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 30a92220..5d8ba2f9 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ VERSION = $(shell grep -m 1 -o '[0-9][0-9.]\+' README) SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz # Find suitable python version (need python >= 2.6 or 3.1): PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \ - which python || which python3.1 || which python3 || which python2.6) + which python || which python3.2 || which python3.1 || which python3 || \ + which python2.6) SETUPOPTS ?= '--record=install_log.txt' DOCDIR ?= doc/pydoc DESTDIR ?= / @@ -37,11 +38,14 @@ options: help @echo 'DOCDIR = $(DOCDIR)' help: - @echo 'make install: Install $(NAME)' - @echo 'make doc: Create the pydoc documentation' - @echo 'make clean: Remove the compiled files (*.pyc, *.pyo)' + @echo 'make install: Install $(NAME)' + @echo 'make clean: Remove the compiled files (*.pyc, *.pyo)' + @echo 'make doc: Create the pydoc documentation' @echo 'make cleandoc: Remove the pydoc documentation' + @echo 'make man: Compile the manpage with "pod2man"' + @echo 'make manhtml: Compile the html manpage with "pod2html"' @echo 'make snapshot: Create a tar.gz of the current git revision' + @echo 'make todo: Look for TODO and XXX markers in the source code' install: $(PYTHON) setup.py install $(SETUPOPTS) \ -- cgit 1.4.1-2-gfad0 From 5fca2a0b63bb565ab4faba135dc1d201c3b05725 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 7 Oct 2011 18:42:28 +0200 Subject: Makefile: added `make test' back in. --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5d8ba2f9..f7950392 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ PYOPTIMIZE ?= 1 CWD = $(shell pwd) -default: compile +default: test compile @echo 'Run `make options` for a list of all options' options: help @@ -38,6 +38,7 @@ options: help @echo 'DOCDIR = $(DOCDIR)' help: + @echo 'make: Test and compile ranger.' @echo 'make install: Install $(NAME)' @echo 'make clean: Remove the compiled files (*.pyc, *.pyo)' @echo 'make doc: Create the pydoc documentation' @@ -45,6 +46,7 @@ help: @echo 'make man: Compile the manpage with "pod2man"' @echo 'make manhtml: Compile the html manpage with "pod2html"' @echo 'make snapshot: Create a tar.gz of the current git revision' + @echo 'make test: Test all testable modules of ranger' @echo 'make todo: Look for TODO and XXX markers in the source code' install: @@ -66,6 +68,12 @@ doc: cleandoc pydoc.writedocs("$(CWD)")' find . -name \*.html -exec sed -i 's|'$(CWD)'|../..|g' -- {} \; +test: + @for FILE in $(shell grep -IHm 1 doctest -r ranger | cut -d: -f1); do \ + echo "Testing $$FILE..."; \ + ${PYTHON} $$FILE; \ + done + man: pod2man --stderr --center='ranger manual' --date='$(NAME)-$(VERSION)' \ --release=$(shell date +%x) doc/ranger.pod doc/ranger.1 -- cgit 1.4.1-2-gfad0 From 7ed4e620b2dbdb3f3af5c9ce2a3e2a3cd748b95f Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 8 Oct 2011 00:17:42 +0200 Subject: Makefile: Fixed doctests for python3.2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f7950392..48fada92 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ doc: cleandoc test: @for FILE in $(shell grep -IHm 1 doctest -r ranger | cut -d: -f1); do \ echo "Testing $$FILE..."; \ - ${PYTHON} $$FILE; \ + PYTHONPATH=".:"$$PYTHONPATH ${PYTHON} $$FILE; \ done man: -- cgit 1.4.1-2-gfad0 From 562ad4dbb80cc528b2403e40c914cb14c164243d Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 10 Oct 2011 23:51:58 +0200 Subject: Updated copyright headers As much as I hate this, it has to be done --- Makefile | 2 +- ranger.py | 2 +- ranger/__init__.py | 2 +- ranger/api/apps.py | 2 +- ranger/api/commands.py | 2 +- ranger/api/options.py | 2 +- ranger/colorschemes/default.py | 2 +- ranger/colorschemes/default88.py | 2 +- ranger/colorschemes/jungle.py | 2 +- ranger/colorschemes/snow.py | 2 +- ranger/container/bookmarks.py | 2 +- ranger/container/history.py | 2 +- ranger/container/settingobject.py | 2 +- ranger/container/tags.py | 2 +- ranger/core/actions.py | 2 +- ranger/core/environment.py | 2 +- ranger/core/fm.py | 2 +- ranger/core/helper.py | 2 +- ranger/core/loader.py | 2 +- ranger/core/main.py | 2 +- ranger/core/runner.py | 2 +- ranger/core/shared.py | 2 +- ranger/defaults/apps.py | 2 +- ranger/defaults/commands.py | 2 +- ranger/defaults/options.py | 2 +- ranger/ext/accumulator.py | 2 +- ranger/ext/curses_interrupt_handler.py | 2 +- ranger/ext/direction.py | 2 +- ranger/ext/get_executables.py | 2 +- ranger/ext/human_readable.py | 2 +- ranger/ext/iter_tools.py | 2 +- ranger/ext/keybinding_parser.py | 2 +- ranger/ext/mount_path.py | 2 +- ranger/ext/openstruct.py | 2 +- ranger/ext/relative_symlink.py | 2 +- ranger/ext/shell_escape.py | 2 +- ranger/ext/signals.py | 2 +- ranger/ext/spawn.py | 2 +- ranger/ext/widestring.py | 2 +- ranger/fsobject/directory.py | 2 +- ranger/fsobject/file.py | 2 +- ranger/fsobject/fsobject.py | 2 +- ranger/gui/ansi.py | 2 +- ranger/gui/bar.py | 2 +- ranger/gui/color.py | 2 +- ranger/gui/colorscheme.py | 2 +- ranger/gui/context.py | 2 +- ranger/gui/curses_shortcuts.py | 2 +- ranger/gui/displayable.py | 2 +- ranger/gui/mouse_event.py | 2 +- ranger/gui/ui.py | 2 +- ranger/gui/widgets/browsercolumn.py | 2 +- ranger/gui/widgets/browserview.py | 2 +- ranger/gui/widgets/console.py | 2 +- ranger/gui/widgets/pager.py | 2 +- ranger/gui/widgets/statusbar.py | 2 +- ranger/gui/widgets/taskview.py | 2 +- ranger/gui/widgets/titlebar.py | 2 +- setup.py | 2 +- 59 files changed, 59 insertions(+), 59 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 48fada92..8adae6a0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger.py b/ranger.py index 29f0a636..c763a8d9 100755 --- a/ranger.py +++ b/ranger.py @@ -1,6 +1,6 @@ #!/usr/bin/python -O # ranger - a vim-inspired file manager for the console (coding: utf-8) -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/__init__.py b/ranger/__init__.py index ce80d0b6..486320bb 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/api/apps.py b/ranger/api/apps.py index 62632df2..1af3167b 100644 --- a/ranger/api/apps.py +++ b/ranger/api/apps.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/api/commands.py b/ranger/api/commands.py index 5b1555a0..1479e1ce 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/api/options.py b/ranger/api/options.py index ee947b39..e2558ffb 100644 --- a/ranger/api/options.py +++ b/ranger/api/options.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py index 03122c59..fb46dd43 100644 --- a/ranger/colorschemes/default.py +++ b/ranger/colorschemes/default.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/colorschemes/default88.py b/ranger/colorschemes/default88.py index 9c00d9ff..8bf33807 100644 --- a/ranger/colorschemes/default88.py +++ b/ranger/colorschemes/default88.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/colorschemes/jungle.py b/ranger/colorschemes/jungle.py index f5e03c06..ea2e0d94 100644 --- a/ranger/colorschemes/jungle.py +++ b/ranger/colorschemes/jungle.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/colorschemes/snow.py b/ranger/colorschemes/snow.py index a449db87..a8125ee6 100644 --- a/ranger/colorschemes/snow.py +++ b/ranger/colorschemes/snow.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py index 0dcfcbc3..750515c5 100644 --- a/ranger/container/bookmarks.py +++ b/ranger/container/bookmarks.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/container/history.py b/ranger/container/history.py index 62965a31..dd511d0e 100644 --- a/ranger/container/history.py +++ b/ranger/container/history.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/container/settingobject.py b/ranger/container/settingobject.py index f7507b3e..5c24d663 100644 --- a/ranger/container/settingobject.py +++ b/ranger/container/settingobject.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/container/tags.py b/ranger/container/tags.py index 24fbd0a5..9c1c68a0 100644 --- a/ranger/container/tags.py +++ b/ranger/container/tags.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 6449456b..0989e168 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/environment.py b/ranger/core/environment.py index 1f37bde5..b5ab223d 100644 --- a/ranger/core/environment.py +++ b/ranger/core/environment.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/fm.py b/ranger/core/fm.py index 4383a9ab..93ac793b 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/helper.py b/ranger/core/helper.py index eedbbb78..995be7c5 100644 --- a/ranger/core/helper.py +++ b/ranger/core/helper.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/loader.py b/ranger/core/loader.py index 018a31df..e1262718 100644 --- a/ranger/core/loader.py +++ b/ranger/core/loader.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/main.py b/ranger/core/main.py index abb1d469..bb920e71 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/runner.py b/ranger/core/runner.py index d9f9083b..2773d2bd 100644 --- a/ranger/core/runner.py +++ b/ranger/core/runner.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/core/shared.py b/ranger/core/shared.py index ce7c3184..e1aa5e65 100644 --- a/ranger/core/shared.py +++ b/ranger/core/shared.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py index a5618482..90e54bbe 100644 --- a/ranger/defaults/apps.py +++ b/ranger/defaults/apps.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index bd2bc025..3696833b 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py index 996d83f5..4510f764 100644 --- a/ranger/defaults/options.py +++ b/ranger/defaults/options.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/accumulator.py b/ranger/ext/accumulator.py index 75f58ad7..d68bc656 100644 --- a/ranger/ext/accumulator.py +++ b/ranger/ext/accumulator.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/curses_interrupt_handler.py b/ranger/ext/curses_interrupt_handler.py index 4e2845cc..7c5b153e 100644 --- a/ranger/ext/curses_interrupt_handler.py +++ b/ranger/ext/curses_interrupt_handler.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/direction.py b/ranger/ext/direction.py index 7ae12f3f..8a37c54a 100644 --- a/ranger/ext/direction.py +++ b/ranger/ext/direction.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/get_executables.py b/ranger/ext/get_executables.py index 22c08eb9..c19798a6 100644 --- a/ranger/ext/get_executables.py +++ b/ranger/ext/get_executables.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/human_readable.py b/ranger/ext/human_readable.py index 3ce6498a..9cdce409 100644 --- a/ranger/ext/human_readable.py +++ b/ranger/ext/human_readable.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/iter_tools.py b/ranger/ext/iter_tools.py index f1cb2d74..e515fa07 100644 --- a/ranger/ext/iter_tools.py +++ b/ranger/ext/iter_tools.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py index 2aa1ae82..90402fe3 100644 --- a/ranger/ext/keybinding_parser.py +++ b/ranger/ext/keybinding_parser.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/mount_path.py b/ranger/ext/mount_path.py index ba7dd052..31d6c602 100644 --- a/ranger/ext/mount_path.py +++ b/ranger/ext/mount_path.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/openstruct.py b/ranger/ext/openstruct.py index a94c3031..b538d384 100644 --- a/ranger/ext/openstruct.py +++ b/ranger/ext/openstruct.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/relative_symlink.py b/ranger/ext/relative_symlink.py index 62f18a4f..420f186c 100644 --- a/ranger/ext/relative_symlink.py +++ b/ranger/ext/relative_symlink.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/shell_escape.py b/ranger/ext/shell_escape.py index ec9e4b12..28a502bf 100644 --- a/ranger/ext/shell_escape.py +++ b/ranger/ext/shell_escape.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/signals.py b/ranger/ext/signals.py index b318036f..ecb48de3 100644 --- a/ranger/ext/signals.py +++ b/ranger/ext/signals.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/spawn.py b/ranger/ext/spawn.py index 9723c1ed..b1f04cf6 100644 --- a/ranger/ext/spawn.py +++ b/ranger/ext/spawn.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/ext/widestring.py b/ranger/ext/widestring.py index 8986be61..525e1bc1 100644 --- a/ranger/ext/widestring.py +++ b/ranger/ext/widestring.py @@ -1,5 +1,5 @@ # -*- encoding: utf8 -*- -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index 9d07dbef..9cfbb6c0 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/fsobject/file.py b/ranger/fsobject/file.py index 3acd70f2..66bc549b 100644 --- a/ranger/fsobject/file.py +++ b/ranger/fsobject/file.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 84b07e61..d74b21c1 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/ansi.py b/ranger/gui/ansi.py index 2a4c4461..e2fd581d 100644 --- a/ranger/gui/ansi.py +++ b/ranger/gui/ansi.py @@ -1,5 +1,5 @@ # Copyright (C) 2010 David Barnett -# Copyright (C) 2010 Roman Zimbelmann +# Copyright (C) 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/bar.py b/ranger/gui/bar.py index c9502024..40218fb1 100644 --- a/ranger/gui/bar.py +++ b/ranger/gui/bar.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/color.py b/ranger/gui/color.py index 67be30f7..889f9e9a 100644 --- a/ranger/gui/color.py +++ b/ranger/gui/color.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py index e577621b..bc5a67a5 100644 --- a/ranger/gui/colorscheme.py +++ b/ranger/gui/colorscheme.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/context.py b/ranger/gui/context.py index a4219806..3e7ca505 100644 --- a/ranger/gui/context.py +++ b/ranger/gui/context.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py index f654ab11..a977beda 100644 --- a/ranger/gui/curses_shortcuts.py +++ b/ranger/gui/curses_shortcuts.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # Copyright (C) 2010 David Barnett # # This program is free software: you can redistribute it and/or modify diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py index e20640d4..5e9562a7 100644 --- a/ranger/gui/displayable.py +++ b/ranger/gui/displayable.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/mouse_event.py b/ranger/gui/mouse_event.py index 4a2860b8..cb697d8d 100644 --- a/ranger/gui/mouse_event.py +++ b/ranger/gui/mouse_event.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 098f6a44..91d0d774 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 0adcd27a..b6b745aa 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -1,5 +1,5 @@ # -*- encoding: utf8 -*- -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py index 30cb4cde..d386d389 100644 --- a/ranger/gui/widgets/browserview.py +++ b/ranger/gui/widgets/browserview.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index ce801a7f..406a2fe9 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index 08c6020d..c9b67736 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # Copyright (C) 2010 David Barnett # # This program is free software: you can redistribute it and/or modify diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 1a606aec..1e2e2520 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/widgets/taskview.py b/ranger/gui/widgets/taskview.py index caa4dd77..c4476b9c 100644 --- a/ranger/gui/widgets/taskview.py +++ b/ranger/gui/widgets/taskview.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py index 9f97bbbe..6b92ccfa 100644 --- a/ranger/gui/widgets/titlebar.py +++ b/ranger/gui/widgets/titlebar.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 diff --git a/setup.py b/setup.py index 0d72978b..e93b092a 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (C) 2009, 2010 Roman Zimbelmann +# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann # # 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 -- cgit 1.4.1-2-gfad0