peircej / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

sort by file name needs to be set again #165

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Get in a directory pictures which are listed differently if you choose name 
or date sorting 
2. Open jbrout on that directory, select sort by name ascending
3. Switch to another directory, and come back to first one

What is the expected output? What do you see instead?
According to the settings the directory must be sorted by name
Instead it is sorted by date (or else)

What version of the product are you using? On what operating system?
recent svn copy 2010-08-19
Mandriva Linux

Please provide any additional information below.
When run from a shell, some warnings are raising :
$ ./jbrout.py 
The psyco module does not seem to be installed. It is not necessary, however it 
can speed up performance.
/home/user/jbrout/plugins/multiexport/libs/picasaweb/gdata/tlslite/utils/cryptom
ath.py:9: DeprecationWarning: the sha module is deprecated; use the hashlib 
module instead
  import sha
./jbrout.py:923: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()

Original issue reported on code.google.com by antonin....@gmail.com on 9 Sep 2010 at 10:28

GoogleCodeExporter commented 8 years ago
> recent svn copy 2010-08-19
This might be revision r305

Original comment by antonin....@gmail.com on 9 Sep 2010 at 10:31

GoogleCodeExporter commented 8 years ago
don't understand ... sorry

Original comment by manat...@gmail.com on 11 Oct 2010 at 6:07

GoogleCodeExporter commented 8 years ago
I try to make it clearer.

1. Get a directory where pictures are listed differently if you choose filename 
or date sorting 
2. Open jbrout on that directory, select sort by filename ascending (Menu > 
Display > Order >  Date or File - Asc or Desc)
3. Switch to another directory, and come back to first one

> What do you see ?
The pictures are sorted by date instead of by filename

Original comment by club-alp...@laposte.net on 11 Oct 2010 at 6:23

GoogleCodeExporter commented 8 years ago
> Get a directory where pictures are listed differently if you choose filename 
or date sorting 

?!? 
Sorry ... I haven't that ;-(
I choosed to rename pictures according exif datetime ...
so sorting by names or by dates show me up the same thing.

I'm pretty sure that it's not me who add the "sort by filename option" ;-)
"this feature should not exist" ;-)
I will dig on this 

Original comment by manat...@gmail.com on 11 Oct 2010 at 6:43

GoogleCodeExporter commented 8 years ago
It seems this feature was added with r265 release ;-)

Thierry are you here ? ;-)

Original comment by manat...@gmail.com on 11 Oct 2010 at 6:44

GoogleCodeExporter commented 8 years ago
I can confirm.
chose Display / Order / File
Then the folder is sorted by filename instead of date.
But at the next folder change, this setting will still be checked in the menu, 
but never effective.

Two others bugs : 
The alphabetical order is first upper letters, then lower letters, then 
accentuated letters (ascii/utf-8 value sorting).
If you sort a folder containing folders, it will be sorted first by subfolder 
then by filename.

Original comment by p...@gmx.fr on 12 Oct 2010 at 10:34

GoogleCodeExporter commented 8 years ago
I found it, but i see it has already been fixed in your r314, when the line
1369      self.tbl.init(ln,JBrout.conf["orderAscending"])
becomes
1406      self.tbl.init(ln,JBrout.conf["orderAscending"],JBrout.conf["orderBy"])

This issue can be closed.

Original comment by p...@gmx.fr on 29 Oct 2010 at 10:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
It's now OK for me (r316)
But the orderBy filename seems to actually include pathname, so in a directory 
with subdirectories, pictures are first sorted byDirectoryName and then 
byFileName. 
That does not annoy me, it's even useful.

I don't know if the name "File" in the sorting-menu needs to be changed to be 
more precise... "Directory+File" sorting ?

Original comment by antonin....@gmail.com on 30 Oct 2010 at 12:25

GoogleCodeExporter commented 8 years ago
One of the problems left was the sorting starting with uppercases, then 
lowercases, then accented letters (AZazà instead of AaàZz).
I found two ways to fix this problem, in jbrout.py.

The first way uses removeAccentedChars() and .lower() in the current code, 
lines 273 and 275.

The second and better way is 
42 import locale
43 locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') # i didn't care about the 
locale i put

271      elif orderBy == "File": # order by file
            if orderAscending:
                l.sort( cmp=lambda x,y: locale.strcoll(x.file,y.file))
            else:
                l.sort( cmp=lambda x,y: -locale.strcoll(x.file,y.file))

I think this second way is better because it's only one function call instead 
of three (and so the line of code is smaller), and it handles the characters æ 
and œ, not handled by removeAccentedChars.

(By the way, you don't use removeAccentedChars() in jbrout.)

Original comment by p...@gmx.fr on 5 Nov 2010 at 11:38

GoogleCodeExporter commented 8 years ago
Comment 9 request implemented in r320
Comment 10 recommendation implemented in r319

Original comment by r...@wallace.gen.nz on 7 Nov 2010 at 8:40

GoogleCodeExporter commented 8 years ago
At first i thought so, but in fact we don't need locale.setlocale() on line 43.

Original comment by p...@gmx.fr on 7 Nov 2010 at 10:19

GoogleCodeExporter commented 8 years ago
Issue 214 has been merged into this issue.

Original comment by matej.c...@gmail.com on 28 Aug 2013 at 1:59