You are not logged in.
hi
i know im probably stupid but i cant setup atool to unpack files like i want. ive tried this:
class aunpack(Command):
def execute(self):
action = ['shell aunpack %s']
self.fm.execute_command(action, flags='d')
and also this:
class aunpack(Command):
def execute(self):
action = ['aunpack %f']
self.fm.execute_console(action)
but i failed with both. if i issue this in the cli it works well:
:shell aunpack %f
it works well
can someone point me in the right direction?
thx
zeltak
Offline
Just like the key binding:
class aunpack(Command):
def execute(self):
self.fm.execute_console("shell aunpack %s")
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Thanks again hut for this great app which is the only fm I am using now. Since last update, I noticed the lack a preview of some .srt files (subtitles). Ranger does not show for them any previews like it did before and says the following thing : "utf8 codec can't decode bytes in position x-x : invalid data".
Thanks for your help,
Sirsurthur
Offline
and "ranger --debug" says what?
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
This :
ranger --debug
Traceback (most recent call last):
File "/usr/lib/python3.1/site-packages/ranger/core/main.py", line 85, in main
fm.loop()
File "/usr/lib/python3.1/site-packages/ranger/core/fm.py", line 190, in loop
loader.work()
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 234, in work
self.fm.notify(err)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 229, in work
next(item.load_generator)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 114, in generate
self.signal_emit('after', process=process, loader=self)
File "/usr/lib/python3.1/site-packages/ranger/ext/signals.py", line 96, in signal_emit
fnc(signal)
File "/usr/lib/python3.1/site-packages/ranger/core/actions.py", line 616, in on_after
data[(-1, -1)] = open(path, 'r').read(1024 * 32)
File "/usr/lib/python3.1/codecs.py", line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 39-40: invalid data
Ranger crashed. Please report this (including the traceback) at:
http://savannah.nongnu.org/bugs/?group= … nc=additem
Thanks
Offline
And another question: I'm guessing you use scope.sh? Does this occur if you turn off scope? (e.g. by renaming scope.sh)
Until this is fixed (which might take a while), try using python2.6. It should work there.
(Edit PKGBUILD, replace "python" with "python2")
Last edited by hut (2010-10-24 15:03:49)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Indeed I am using scope.sh. By renaiming it, ranger does not crash anymore but it still does not show any preview of this .srt files. For now, I am indeed using ranger with python 3.0.
I guess I will stay with ranger/python3 for now. It's not that a big issue but wanted you to be aware of it.
Thanks for your answers,
Sirsurthur
----
Edit : for your information, I also got this crash during a .pdf preview :
ranger --debug
Traceback (most recent call last):
File "/usr/lib/python3.1/site-packages/ranger/core/main.py", line 85, in main
fm.loop()
File "/usr/lib/python3.1/site-packages/ranger/core/fm.py", line 190, in loop
loader.work()
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 234, in work
self.fm.notify(err)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 229, in work
next(item.load_generator)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 98, in generate
read = read.decode('utf-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 511: unexpected end of data
Last edited by Sirsurthur (2010-10-24 15:12:34)
Offline
how can i set wich application open each file?
Offline
ranger --debug
Traceback (most recent call last):
File "/usr/lib/python3.1/site-packages/ranger/core/main.py", line 85, in main
fm.loop()
File "/usr/lib/python3.1/site-packages/ranger/core/fm.py", line 190, in loop
loader.work()
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 234, in work
self.fm.notify(err)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 229, in work
next(item.load_generator)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 98, in generate
read = read.decode('utf-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 511: unexpected end of data
Aw. That looks bad. Did I mention that I hate encoding stuff?
Thanks for taking your time to report the bugs.
how can i set wich application open each file?
First, run this:
ranger --copy-config=apps
And then edit ~/.config/ranger/apps.py.
There's documentation:
1. inside the file (~/.config/ranger/apps.py)
2. in the help chapter 2. Type "2?" in ranger
Last edited by hut (2010-10-24 15:39:28)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
when i make ranger --copy-config=apps this is the result:
Usage: ranger [options] [path/filename]
ranger: error: no such option: --copy-config
and now?
Offline
when i make ranger --copy-config=apps this is the result:
Usage: ranger [options] [path/filename]
ranger: error: no such option: --copy-configand now?
Oh. Okay, then try:
cp /usr/lib/python3.1/site-packages/ranger/defaults/apps.py ~/.config/ranger/apps.py
If this doesn't work, you can also type this in ranger =P
gRfdejyycd~/.config/ranger<ENTER>pp
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hi hut
using your excellent advice i have a keyboard short (and command) to unpack files using atool. if anyone is interested its mapped to au:
map('au', fm.execute_console('shell aunpack %s'))
for the packing its a bit tricky since the apack command (apack myarchive.zip foo bar) expects a file name for the packed file in addition to the marked files.
is there a macro or other method i can use that will give the archive the name of the folder/first file slected to the packed files so i can use that? i currently have this:
map('ap', fm.execute_console('shell apack %s')) but i missing the file name part..any ideas?
thx
zeltak
Offline
The simple way would be to modify the "@" binding:
map('@', fm.open_console('shell %s', position=len('shell ')))
turn that into
map('ap', fm.open_console('shell apack %s', position=len('shell apack ')))
Now you just have to type in the name for the package.
The thing you described needs a custom python function.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Thx hut, its perfect now
if you add a wiki to the site i can add the copy path and archive stuff to it
ranger is just perfection
thx
zeltaj
Offline
Hi Hut, I have some new stuff for you to fix
I wanted to rename a file. The new name included a german umlaut (äöü), but ranger doesn't do this right. I think I remember that it used to work. Could you please fix that?
And there's something which would be very cool. Could you implement ranger to recognize, that it's started on tty and if so, ranger should use other applications, e.g. a tool named fbi for images, mplayer -vo fbdev2 for video etc. That would be very cool! But of course this shouldn't be a high priority, I just wanted to show the idea.
Offline
Hello Hut,
Can I suggest a new mouvement key for tab management:
gN : create a new tab with a defined path of the actual screen/tab (where you have typed the mouvement key).
Thx again for your work on ranger, the ultimate filemanager !
Offline
if you add a wiki to the site i can add the copy path and archive stuff to it
I think savannah only allows static content.
Perhaps we should use the github wiki for that?
Dunno.
Hi Hut, I have some new stuff for you to fix
I wanted to rename a file. The new name included a german umlaut (äöü), but ranger doesn't do this right. I think I remember that it used to work. Could you please fix that?
Okay. Thats another python3 related encoding issue, I'll deal with that some other day.
And there's something which would be very cool. Could you implement ranger to recognize, that it's started on tty and if so, ranger should use other applications, e.g. a tool named fbi for images, mplayer -vo fbdev2 for video etc. That would be very cool! But of course this shouldn't be a high priority, I just wanted to show the idea.
Are you familiar with manipulating apps.py?
Just add something like this to branch off between situations with and without X:
if 'DISPLAY' in os.environ:
(If it says os is undefined, add an "import os" first.)
Hello Hut,
Can I suggest a new mouvement key for tab management:
gN : create a new tab with a defined path of the actual screen/tab (where you have typed the mouvement key).
Thx again for your work on ranger, the ultimate filemanager !
Try gn`` or gn''
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Are you familiar with manipulating apps.py?
Just add something like this to branch off between situations with and without X:if 'DISPLAY' in os.environ:
(If it says os is undefined, add an "import os" first.)
I was capable to edit the apps.py for my needs, but this tty vs xorg thing is too much for me, I don't know python that well. But thanks for these hints, I'll give it a try. Thanks!!
Last edited by Army (2010-10-26 15:40:20)
Offline
Wow, that was easier than I expected, just took me two minutes Thanks a lot hut!
Offline
make Ranger's S set os.environ['PS1'], and make your shell rc a) not set PS1 if it's already set or b) append to it
Ack, I'm having trouble figuring out how to do this (different PS1 when in shell from hitting 'S')....I get the concept, but the execution is kicking my butt!
Thanks!
Scott
Last edited by firecat53 (2010-10-27 22:05:31)
Offline
keys.py:
import os
map = keymanager.get_context('browser')
@map('S')
def betterS(arg):
os.environ['RANGER_PS'] = 'RANGER $ '
arg.fm.execute_command(os.environ['SHELL'])
.bashrc:
[ -z "$RANGER_PS" ] || PS1="$RANGER_PS"
Last edited by hut (2010-10-27 22:16:18)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
how can i do to delete with the "Supr" key? and without the cuestion "Seriously?" ?
Offline
how can i do to delete with the "Supr" key? and without the cuestion "Seriously?" ?
The super key (windows key, right?) is technically not supported. I think even the terminal can't recognize it.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
nono...the "Del" key. The normal key to delete files in X11
Offline
@hut: Thanks! That works perfectly. Any idea how to get the escape codes to pass through for current directory, etc.? I tried using the unidecode module to process the values, but that didn't work.
Thanks!
Scott
Edit: Solved. I just set the Ranger PS1 with escape codes in .bashrc instead of setting it = RANGER_PS1.
Last edited by firecat53 (2010-10-27 22:45:15)
Offline