Commit message (Expand) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | widgets.taskview: show progressbar only if task supports it | hut | 2012-08-07 | 2 | -5/+9 | |
* | | widgets.taskview: added progressbars for dir loading tasks | hut | 2012-08-07 | 5 | -2/+14 | |
* | | examples/rifle_sxiv.sh: fix symlink handling | hut | 2012-08-07 | 1 | -1/+1 | |
* | | core.tab: fix weakref bug with python2 that breaks fm.thisfile | hut | 2012-08-07 | 1 | -2/+7 | |
* | | ext.rifle: notify about unknown filetype in rifle when command==ask | hut | 2012-08-06 | 1 | -1/+6 | |
* | | ext.rifle: strip newline off mimetype | hut | 2012-08-06 | 1 | -1/+1 | |
* | | ext.rifle: implemented asking on unknown filetype (in ranger only) | hut | 2012-08-06 | 3 | -2/+9 | |
* | | added the examples from the man page to the examples directory | hut | 2012-08-06 | 5 | -4/+46 | |
* | | widgets.titlebar: fixed crash on ':set dirname_in_tabs True' | hut | 2012-08-06 | 1 | -1/+1 | |
* | | core.fm: fixed passing directory arguments | hut | 2012-08-06 | 3 | -8/+16 | |
* | | core.actions: some cleaning | hut | 2012-08-06 | 1 | -5/+1 | |
* | | core.actions: get _get_macros to work with new tab system | hut | 2012-08-06 | 1 | -22/+24 | |
* | | config.commands: fixed bug in :delete and :find | hut | 2012-08-05 | 1 | -2/+2 | |
* | | config/rifle.conf: fixed .ogg files | hut | 2012-08-05 | 1 | -3/+3 | |
* | | config/rifle.conf: stricter settings for scripts | hut | 2012-08-05 | 1 | -6/+6 | |
* | | core.actions: fix tab-history bugs, inherit history from prev. tab | hut | 2012-08-05 | 3 | -2/+19 | |
* | | core.actions: Added {old,new} arguments to 'tba.change' signal | hut | 2012-08-05 | 2 | -3/+6 | |
* | | add keybinding 'uq' to restore a closed tab | hut | 2012-08-05 | 4 | -0/+20 | |
* | | core.tab: save and restore pointer when changing tab | hut | 2012-08-05 | 1 | -0/+10 | |
* | | core.tab: pass the tab as argument in the move-signal | hut | 2012-08-05 | 1 | -2/+2 | |
* | | core.actions: updated tab_open to work with new Tab class | hut | 2012-08-05 | 2 | -5/+14 | |
* | | Replaced core.environment with core.tab | hut | 2012-08-05 | 15 | -291/+369 | |
* | | moved fm.env.get_directory() to fm.get_directory() | hut | 2012-08-05 | 6 | -20/+24 | |
* | | moved env.garbage_collect to fm.garbage_collect | hut | 2012-08-05 | 2 | -18/+21 | |
* | | core.environment: cleanup | hut | 2012-08-05 | 1 | -8/+4 | |
* | | core.environment: removed unused attribute 'cmd' | hut | 2012-08-05 | 1 | -1/+0 | |
* | | moved fm.env.{username,hostname,home_path} to fm.* | hut | 2012-08-05 | 5 | -18/+29 | |
* | | core.environment: added a layer for backwards compatibility | hut | 2012-08-05 | 1 | -1/+20 | |
* | | move fm.env.{keymaps,keybuffer} to fm.ui.{keymaps,keybuffer} | hut | 2012-08-05 | 11 | -26/+29 | |
* | | move fm.env.{copy,cut} to fm.{copy_buffer,do_cut} | hut | 2012-08-05 | 5 | -24/+23 | |
* | | core.environment: s/fm.env.directories/fm.directories | hut | 2012-08-05 | 2 | -10/+9 | |
* | | core.environment: s/fm.env.termsize/fm.ui.termsize | hut | 2012-08-05 | 4 | -6/+6 | |
* | | core.actions: More reliable mimetype checking @ execute_file | hut | 2012-08-05 | 1 | -3/+2 | |
* | | core.fm: moved attributes of core.action to core.fm for clarity | hut | 2012-08-05 | 2 | -7/+8 | |
* | | core.environment: removed unused functions | hut | 2012-08-05 | 1 | -14/+0 | |
* | | added scripts directory. rifle is now installed to /usr/bin/ | hut | 2012-08-04 | 4 | -2/+3 | |
* | | Revert e4f37e51 for backwards compatibility | hut | 2012-08-04 | 1 | -1/+1 | |
* | | doc/ranger.1: rebuilt man page | hut | 2012-08-02 | 1 | -5/+5 | |
* | | core.helper: moved functions to ranger and ranger.core.main | hut | 2012-08-02 | 4 | -177/+172 | |
* | | core.fm: stick to line length limit | hut | 2012-08-02 | 1 | -2/+4 | |
* | | widgets.browsercolumn: Fix disappearance of infostring | hut | 2012-08-02 | 1 | -1/+1 | |
* | | widgets.browsercolumn: fixed not drawing of unicode surrogates | hut | 2012-08-02 | 1 | -2/+1 | |
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */if __name__ == '__main__': from __init__ import init; init()
import unittest
import curses
from random import randint
from ranger.gui.displayable import Displayable, DisplayableContainer
from test import Fake, OK, raise_ok
class TestDisplayable(unittest.TestCase):
def setUp(self):
self.win = Fake()
self.fm = Fake()
self.env = Fake()
self.settings = Fake()
self.disp = Displayable( win=self.win,
env=self.env, fm=self.fm, settings=self.settings)
hei, wid = 100, 100
self.env.termsize = (hei, wid)
def tearDown(self):
self.disp.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_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)
box = (randint(10, 20), randint(30, 40), \
randint(30, 40), randint(10, 20))
def in_box(y, x):
return (x >= box[1] and x < box[1] + box[3]) and \
(y >= box[0] and y < box[0] + box[2])
disp.resize(*box)
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)
class TestDisplayableContainer(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.disc.destroy()
def test_container(self):
self.assertTrue(self.disp in self.disc.container)
def test_click(self):
self.disp.click = raise_ok
self.disc.resize(0, 0, 50, 50)
self.disp.resize(0, 0, 20, 20)
fakepos = Fake()
fakepos.x = 10
fakepos.y = 10
self.assertRaises(OK, self.disc.click, fakepos)
fakepos.x = 30
fakepos.y = 10
self.disc.click(fakepos)
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])
if __name__ == '__main__':
unittest.main()
|