summary refs log tree commit diff stats
path: root/doc
Commit message (Expand)AuthorAgeFilesLines
* removed pydoc since it can be generated with "make doc" easilyhut2010-06-2146-6669/+0
* version = version + 1 v1.1.1hut2010-06-184-6/+7
* new stable version v1.1.0hut2010-06-092-3/+3
* updated manpagehut2010-06-091-5/+4
* renamed "--fail-if-run" to the more accurate "--fail-unless-cd"hut2010-06-091-3/+3
* updated pydochut2010-06-0918-57/+113
* Changed hashbang line to "#!/usr/bin/env python"hut2010-06-092-2/+2
* updated pydochut2010-05-1647-666/+349
* Fixed bug #65 by adding flag "--fail-if-run"hut2010-04-261-1/+5
* updated pydochut2010-04-205-248/+10
* updated pydochut2010-04-1941-2286/+247
* ranger.1: added S key to man pagehut2010-04-161-0/+3
* Fixed suggested cd-after-exit-script for zshhut2010-04-131-1/+1
* added doc/print_keys.pyhut2010-04-081-0/+14
* corrected documentationhut2010-04-061-1/+1
* Improved tabshut2010-04-061-0/+3
* updated keybindings and documentationhut2010-04-061-1/+21
* ranger.1: updatehut2010-04-011-4/+7
* ranger.1: updatedhut2010-04-011-1/+1
* added a man pagehut2010-04-011-0/+187
* rebuilt pydochut2010-03-3118-65/+188
* removed doc/pick.sh, pointless to have it therehut2010-03-311-25/+0
* removed UML stuff, it's uselesshut2010-03-3115-2337/+0
* removed the cd-after-exit hackhut2010-03-291-161/+0
* updated TODO and pydochut2010-03-2120-52/+85
* doc/colorschemes: ugh, its no logical but bitwise OR!hut2010-03-171-1/+1
* incremented verison number v1.0.4hut2010-03-121-2/+2
* standardized formatting of headings in doc/hut2010-03-122-13/+31
* added doc/uml.txthut2010-03-121-0/+5
* updated pydochut2010-03-1217-161/+33
* updated pydochut2010-03-1270-3946/+816
* added two new colorschemes using 88 colorshut2010-03-121-0/+23
* added documentation on how colorschemes workhut2010-03-121-0/+91
* added symlink: doc/help => ranger/helphut2010-02-281-0/+1
* incremented version number and updated pydoc html files v1.0.3hut2010-02-1675-1972/+1415
* doc/cd-after-exit: updatedhut2010-02-141-21/+15
* doc/pick.sh: corrected commit orderhut2010-02-091-1/+1
* doc: what breaks cd-after-exit support in zshhut2010-02-091-0/+2
* pick.sh: added -m to checkout commadshut2010-02-051-3/+3
* pick.sh: added variables for easier customizationhut2010-02-041-7/+8
* added doc/pick.shhut2010-02-041-0/+24
* updated dochut2010-01-211-4/+20
* 1.0.2! v1.0.2hut2010-01-1430-84/+116
* updated pydoc documentationhut2010-01-1361-846/+795
* todo: added more info on bug #31hut2010-01-091-0/+5
* random cleanups and fixeshut2010-01-071-5/+6
* new minor version v1.0.1hut2010-01-022-4/+4
* updated pydoc documentationhut2010-01-0248-788/+3167
* notify: merged into statusbar, allow to view the log in the pagerhut2010-01-013-35/+2
* cleanupshut2009-12-311-1/+5
n class="o">< 0) def horizontal_direction(self): right = Direction.right(self) return (right > 0) - (right < 0) def vertical(self): return set(self) & set(['up', 'down']) def horizontal(self): return set(self) & set(['left', 'right']) def pages(self): return 'pages' in self and self['pages'] def percentage(self): return 'percentage' in self and self['percentage'] def multiply(self, n): for key in ('up', 'right', 'down', 'left'): try: self[key] *= n except: pass def set(self, n): for key in ('up', 'right', 'down', 'left'): if key in self: self[key] = n def move(self, direction, override=None, minimum=0, maximum=9999, current=0, pagesize=1, offset=0): """Calculates the new position in a given boundary. Example: >>> d = Direction(pages=True) >>> d.move(direction=3) 3 >>> d.move(direction=3, current=2) 5 >>> d.move(direction=3, pagesize=5) 15 >>> # Note: we start to count at zero. >>> d.move(direction=3, pagesize=5, maximum=10) 9 >>> d.move(direction=9, override=2) 18 """ pos = direction if override is not None: if self.absolute(): pos = override else: pos *= override if self.pages(): pos *= pagesize elif self.percentage(): pos *= maximum / 100.0 if self.absolute(): if pos < minimum: pos += maximum else: pos += current return int(max(min(pos, maximum + offset - 1), minimum)) def select(self, lst, current, pagesize, override=None, offset=1): dest = self.move(direction=self.down(), override=override, current=current, pagesize=pagesize, minimum=0, maximum=len(lst)) selection = lst[min(current, dest):max(current, dest) + offset] return dest + offset - 1, selection if __name__ == '__main__': import doctest doctest.testmod()