diff options
author | hut <hut@lepus.uberspace.de> | 2016-04-06 21:28:22 +0200 |
---|---|---|
committer | hut <hut@lepus.uberspace.de> | 2016-04-06 21:28:22 +0200 |
commit | a467b7cad6d6c988b958b4ac654cd0898c5541d9 (patch) | |
tree | 2241fb68d24dfb135e3cd8dd2da12f3bdc47357d /ranger | |
parent | 3c6ea0212817cdfff3bebf80e29f2ee9c54b714b (diff) | |
parent | 94ce103247332a8ad56bb41a7245546f824971c3 (diff) | |
download | ranger-a467b7cad6d6c988b958b4ac654cd0898c5541d9.tar.gz |
Merge branch 'mtime_linemode' of https://github.com/Vifon/ranger
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/container/fsobject.py | 3 | ||||
-rw-r--r-- | ranger/core/linemode.py | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py index db6772ac..1d91aff8 100644 --- a/ranger/container/fsobject.py +++ b/ranger/container/fsobject.py @@ -79,7 +79,8 @@ class FileSystemObject(FileManagerAware, SettingsAware): _linemode = DEFAULT_LINEMODE linemode_dict = dict( (linemode.name, linemode()) for linemode in - [DefaultLinemode, TitleLinemode, PermissionsLinemode, FileInfoLinemode] + [DefaultLinemode, TitleLinemode, PermissionsLinemode, FileInfoLinemode, + ModificationTimeLinemode] ) def __init__(self, path, preload=None, path_is_abs=False, basename_is_rel_to=None): diff --git a/ranger/core/linemode.py b/ranger/core/linemode.py index 76e8f7cc..d3aff064 100644 --- a/ranger/core/linemode.py +++ b/ranger/core/linemode.py @@ -102,3 +102,14 @@ class FileInfoLinemode(LinemodeBase): return fileinfo else: raise NotImplementedError + + +class ModificationTimeLinemode(LinemodeBase): + name = "mtime" + + def filetitle(self, file, metadata): + import time + return "%s %s" % (time.ctime(file.stat.st_mtime), file.relative_path) + + def infostring(self, file, metadata): + return "" |