Hamish
unread,Apr 17, 2008, 2:56:58 PM4/17/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Hotwire Shell
Hello, trying to write a sort builtin, but having some trouble getting
it to work. Hope it's reasonable to discuss this here rather than in
the issues.
So we have it accepting input from the pipeline and passing it on.
And it does alter the order, but not as I expect ...
I've uploaded it to the files section of this group (put it in hotwire/
builtins/ and add a line to the end of hotwire/builtin.py). My test
commands tend to look like
proc -a | sort owner_name | newline
newline means that the default renderer does not just do it's own
sorting (on a quick tangent, is there a way to tell the renderer what
order the objects should be in (or more precisely what property to
sort by, and whether to sort forward or reverse), other than clicking
on the column headers ... Be nice to be able to do the equivalent of
ls -t, ls -tr ... )
Does hotwire re-sort objects after they've left my function? Are
there other side effects at work? Have I misunderstood how the
functions should be passed to the sort function?
If I sort it out myself, I'll report back here ...