summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-08-26 22:43:28 +0200
committerhut <hut@lepus.uberspace.de>2014-08-26 22:58:57 +0200
commit207cafb045e8288b0f91df1528b9edb2a2c31971 (patch)
treeeb43936b88311e98c796a023f2c6aaa5117598aa /ranger
parentdc4216a55e80361177675118944a69514618f6c9 (diff)
downloadranger-207cafb045e8288b0f91df1528b9edb2a2c31971.tar.gz
container.directory: implemented random sorting
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/rc.conf3
-rw-r--r--ranger/container/directory.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 5b274657..b2cc9307 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -147,7 +147,7 @@ set autoupdate_cumulative_size false
 # Turning this on makes sense for screen readers:
 set show_cursor false
 
-# One of: size, basename, mtime, type
+# One of: size, natural, basename, atime, ctime, mtime, type, random
 set sort natural
 
 # Additional sorting options
@@ -373,6 +373,7 @@ map <a-9>     tab_open 9
 
 # Sorting
 map or toggle_option sort_reverse
+map oz set sort=random
 map os chain set sort=size;      set sort_reverse=False
 map ob chain set sort=basename;  set sort_reverse=False
 map on chain set sort=natural;   set sort_reverse=False
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 07b2192d..de69c467 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -2,6 +2,7 @@
 # This software is distributed under the terms of the GNU GPL version 3.
 
 import os.path
+import random
 import re
 
 from os import stat as os_stat, lstat as os_lstat
@@ -81,6 +82,7 @@ class Directory(FileSystemObject, Accumulator, Loadable):
         'mtime': lambda path: -(path.stat and path.stat.st_mtime or 1),
         'ctime': lambda path: -(path.stat and path.stat.st_ctime or 1),
         'atime': lambda path: -(path.stat and path.stat.st_atime or 1),
+        'random': lambda path: random.random(),
         'type': lambda path: path.mimetype or '',
     }
 
;hut@lavabit.com> 2010-05-03 23:58:07 +0200 Makefile: cleaned up, added automatic uninstall' href='/akspecs/ranger/commit/Makefile?h=v1.9.0b3&id=b0a216f59a7770f5ce35f4a56b5055c51ceec284'>b0a216f5 ^
3a1e1f28 ^
b0a216f5 ^


b06433bc ^
2c5ea01d ^
b0a216f5 ^

2c5ea01d ^
2c5ea01d ^
2c5ea01d ^
582f3519 ^
b06433bc ^
582f3519 ^

94c5d83e ^
dee6cfa6 ^
e9e4b4ff ^
b0a216f5 ^


e9e4b4ff ^





25a4162d ^
ad75190c ^
e9e4b4ff ^
e9e4b4ff ^
25a4162d ^
e9e4b4ff ^
fde932f2 ^
85fd5288 ^
4ade06a6 ^

85fd5288 ^
0c2c782d ^

636d9393 ^
b0a216f5 ^
b06433bc ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79