You are not logged in.
Some news: I simplified the keybinding module which should reduce rangers startup time by about 40%. (PS: or rather, this fixes the startup time increase of another recent patch...)
Additionally, the configuration file "keys.py" is now obsolete. Keybindings are defined with the :map command instead of using python code.
:map <key> <command>
You can put your map commands into the new configuration file ~/.config/ranger/rc.conf. This file simply contains a list of commands which are executed on startup. Get the default one here or by running "ranger --copy-config=rc".
Bear with me, some things do not work 100% yet and the man page is outdated.
Last edited by hut (2011-09-30 23:04:40)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hi Hut,
With latest updates, I get following bugs :
ranger
Ranger version: 1.4.3, executed with python 3.2.2
Locale: fr_FR.UTF-8
Current file: None
Traceback (most recent call last):
File "/usr/lib/python3.2/site-packages/ranger/container/settingobject.py", line 86, in __getattr__
return self._settings[name]
KeyError: '__call__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 79, in main
load_settings(fm, arg.clean)
File "/usr/lib/python3.2/site-packages/ranger/core/helper.py", line 98, in load_settings
comcont.load_commands_from_object(fm, dir(Actions))
File "/usr/lib/python3.2/site-packages/ranger/api/commands.py", line 60, in load_commands_from_object
if hasattr(attribute, '__call__'):
File "/usr/lib/python3.2/site-packages/ranger/container/settingobject.py", line 94, in __getattr__
" in the defaults!".format(name))
Exception: The option `__call__' was not defined in the defaults!
Ranger crashed. Please report this traceback at:
http://savannah.nongnu.org/bugs/?group= … nc=additem
and
ranger --copy-config=rc
creating: /home/julien/.config/ranger/rc.conf
ERROR: [Errno 2] Aucun fichier ou dossier de ce type: '/usr/lib/python3.2/site-packages/ranger/defaults/rc.conf'
Hope it helps.
Sirsurthur
Offline
Fixed, thanks for the report
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
EDIT: Ninja'd, sorry.
Last edited by Veedrac (2011-09-30 19:58:03)
Offline
Since you're on a development spree, could you look into the uwid function on utfwidth.py?
On my system, if you browse to a folder with an accent like 'Prática' and you have multiple tabs open, you can't see some or all of the tab numbers. I've pinpointed the culprit to being the use of utf_byte_length which, on a python3 code, shouldn't be used since all strings are unicode by default and accessing them by index should already take into account their byte size (afaik). In particular, 'á' is marked as having a byte length of 2 and, therefore, the string slice will result in 'át' (if I'm not mistaken) which seems to mess up the calculations.
By replacing all instances of bytelen with 1 on that function, everything works ok. I've seen that you added some python3 specific code on some parts of the code so maybe you could add a special case there aswell?
Last edited by Revolt (2011-10-01 00:18:16)
Offline
Since you're on a development spree, could you look into the uwid function on utfwidth.py?
On my system, if you browse to a folder with an accent like 'Prática' and you have multiple tabs open, you can't see some or all of the tab numbers. I've pinpointed the culprit to being the use of utf_byte_length which, on a python3 code, shouldn't be used since all strings are unicode by default and accessing them by index should already take into account their byte size (afaik). In particular, 'á' is marked as having a byte length of 2 and, therefore, the string slice will result in 'át' (if I'm not mistaken) which seems to mess up the calculations.
By replacing all instances of bytelen with 1 on that function, everything works ok. I've seen that you added some python3 specific code on some parts of the code so maybe you could add a special case there aswell?
Thanks for the hint. It would be good to know which python version you use, (I tried 2.6, 3.1 and 3.2; all of them produce different results) and which changes you did exactly.
Maybe I should also mention that unicode in ranger currently works best with python 2.6 and I don't remember having any problems with it in a long time.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hi Hut,
Thanks for the updates ! I like the new "statusbar" that works like a popup window. Shall the bookmarks appear in the same window (and not at the left up corner) ?
Best regards,
Sirsurthur
Offline
Thanks for the hint. It would be good to know which python version you use, (I tried 2.6, 3.1 and 3.2; all of them produce different results) and which changes you did exactly.
Maybe I should also mention that unicode in ranger currently works best with python 2.6 and I don't remember having any problems with it in a long time.
Using 3.2.2 here.
I think I just found something on the >=2.4 python lib that seems to do exactly what the utfwidth.py tries to do.
Take a look at the following pages, specifically, the east_asian_width function:
http://docs.python.org/library/unicoded … nicodedata
http://docs.python.org/py3k/library/uni … nicodedata
http://unicode.org/reports/tr11/
Offline
hut wrote:Thanks for the hint. It would be good to know which python version you use, (I tried 2.6, 3.1 and 3.2; all of them produce different results) and which changes you did exactly.
Maybe I should also mention that unicode in ranger currently works best with python 2.6 and I don't remember having any problems with it in a long time.
Using 3.2.2 here.
I think I just found something on the >=2.4 python lib that seems to do exactly what the utfwidth.py tries to do.
Take a look at the following pages, specifically, the east_asian_width function:
http://docs.python.org/library/unicoded … nicodedata
http://docs.python.org/py3k/library/uni … nicodedata
http://unicode.org/reports/tr11/
Nice, that makes much of my code obsolete.
I fixed things and unicode works well in these places now: directory listing, statusbar, titlebar, console (input, output, cursor movement).
Can you please confirm this? Especially with japanese characters? (レンジャ)
Last edited by hut (2011-10-01 16:40:00)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hey hut, nice new code, I like it! Great to see that you are still active on ranger.
Offline
@hut:
Thanks again for your work.
This may help you to track bugs:
There are no bindings on log screen, so we are stuck after pressing `W`.
Typo spotted in rc.conf: map yn shell -d echo -n %%f | xsel -i
narg=quantifier is missing to bindings dd, da, dr, yy, ya and yr. This breaks these bindings when used without a quantifier
Executing ranger -c results as:
Traceback (most recent call last):
File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 79, in main
load_settings(fm, arg.clean)
File "/usr/lib/python3.2/site-packages/ranger/core/helper.py", line 168, in load_settings
from ranger.defaults import commands, keys, apps
ImportError: cannot import name keys
An other error occurs after removing 'keys' from the import line above.
and ranger --list-unused-keys:
Traceback (most recent call last):
File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 85, in main
for key in sorted(special_keys.values()):
TypeError: unorderable types: int() < tuple()
Last edited by PotatoesMaster (2011-10-01 19:51:57)
Offline
Thank you for looking over it.
Normally, narg=quantifier is added for you by ranger, but that mechanism had a little bug. You only have to add it manually when using the eval command.
I fixed/am fixing the other things, thanks again.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Can you please confirm this? Especially with japanese characters? (レンジャ)
It's working hut, I tried it with CJK character.
There's a problem with ranger when using
draw_borders = True
Error message
Ranger version: 1.4.3, executed with python 3.2.2
Locale: en_US.UTF-8
Current file: /home/igndenok/Desktop
Traceback (most recent call last):
File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 103, in main
fm.loop()
File "/usr/lib/python3.2/site-packages/ranger/core/fm.py", line 198, in loop
ui.redraw()
File "/usr/lib/python3.2/site-packages/ranger/gui/ui.py", line 249, in redraw
self.draw()
File "/usr/lib/python3.2/site-packages/ranger/gui/ui.py", line 275, in draw
DisplayableContainer.draw(self)
File "/usr/lib/python3.2/site-packages/ranger/gui/displayable.py", line 268, in draw
displayable.draw()
File "/usr/lib/python3.2/site-packages/ranger/gui/widgets/browserview.py", line 103, in draw
self._draw_borders()
AttributeError: 'BrowserView' object has no attribute '_draw_borders'
Ranger crashed. Please report this traceback at:
http://savannah.nongnu.org/bugs/?group=ranger&func=additem
Last edited by igndenok (2011-10-02 01:41:25)
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
Oops. I must have accidently removed that code. Added back in, thanks.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
hut, still no binding in preview (display_file) pager screen (after press i)?!
Can't scroll up/down, if I press <Left> or <Right> there's an error message in statusbar
unsupported operand type(s) for +: 'NoneType' and 'int'
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
hut, still no binding in preview (display_file) pager screen (after press i)?!
Can't scroll up/down, if I press <Left> or <Right> there's an error message in statusbarunsupported operand type(s) for +: 'NoneType' and 'int'
I fixed it by changing the default rc.conf. Could it be that you don't see the changes because you have a custom (old) rc.conf?
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hut, will you tell us when everything's reimplemented in this new rc.conf style? Would be good to know, because in case I see something's missing, I don't know if you forgot it or if you just still have to add it.
In case you are already finished, will you reimplement the ability to switch between tabs with Alt+Right / Alt+Left? I prefer this over gt and gT. If you won't implement it, for all the others
map <a-right> tab_move 1
map <a-left> tab_move -1
Offline
igndenok wrote:hut, still no binding in preview (display_file) pager screen (after press i)?!
Can't scroll up/down, if I press <Left> or <Right> there's an error message in statusbarunsupported operand type(s) for +: 'NoneType' and 'int'
I fixed it by changing the default rc.conf. Could it be that you don't see the changes because you have a custom (old) rc.conf?
You're right, it's my mistake.
Awesome.
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
Hut, will you tell us when everything's reimplemented in this new rc.conf style? Would be good to know, because in case I see something's missing, I don't know if you forgot it or if you just still have to add it.
In case you are already finished, will you reimplement the ability to switch between tabs with Alt+Right / Alt+Left? I prefer this over gt and gT. If you won't implement it, for all the others
map <a-right> tab_move 1 map <a-left> tab_move -1
Thanks. I am done with the rc.conf for now, so please report anything. FYI, things that I intentionally changed:
1. Removed "O" and "<F1>" in the console (redundant)
2. The keys ^V and u^V, will be replaced by a proper visual mode later.
3. the ability to type stuff like d5j, will be added later. Use 5dj for now.
4. =123 is now 123=
And the hjkl keys don't work in the log yet. Will be fixed later.
You're right, it's my mistake.
Awesome.
I recommend to have minimal config files with only custom changes instead of copying the whole files, unless you never update :>
Last edited by hut (2011-10-02 14:41:50)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
hut, using ranger 1.5.0
I can't create bookmark shortcut using number (because I have bookmark shortcut using number). e.g.: m1, m2, ...
I recommend to have minimal config files with only custom changes instead of copying the whole files, unless you never update :>
Yeah, usually I copying the whole file and adding/modifying some. I use this approach because it's easier to look some forgotten keybinding
in my ~/.config/ranger instead /usr/lib/pythonX.Y/site-packages/ranger/defaults. Thanks for remind me
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
Loving the changes and no more utf8 problems! Nice!
Offline
hut, using ranger 1.5.0
I can't create bookmark shortcut using number (because I have bookmark shortcut using number). e.g.: m1, m2, ...
Works now.
Loving the changes and no more utf8 problems! Nice!
Yup, I'm happy the terror is over. I think I procrastinated that for years.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Great changes Hut !
Will your utf8 code changes help to preview text files with special characters (problem to decode them) ?
Best regards,
Sirsurthur
Offline
I liked ranger very much.
I have few questions. I want to view my pdf files in detached way from ranger. I want to continue back with the ranger rather than closing the pdf and then use ranger.
I found the code in the apps.py
if f.extension in ('pdf', ):
return self.either(c, 'foxitreader', 'okular'
, 'gimp')
what to do now.
Also I want ranger to show the size of the directories ( not the number of files) but the size in MB or GB. And I want to sort as per this size.
Offline
if f.extension in ('pdf', ): return self.either(c, 'foxitreader', 'okular' , 'gimp')
Between the two lines, add
c.flags += 'd'
Also I want ranger to show the size of the directories ( not the number of files) but the size in MB or GB. And I want to sort as per this size.
That is currently not supported
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline