[PATCH] Don't put categories into tags shown in full-screen view.

30 views
Skip to first unread message

Matěj Cepl

unread,
Aug 29, 2013, 6:45:23 PM8/29/13
to jbr...@googlegroups.com, Matěj Cepl
Some program (e.g., Shotwell) puts categories as tags into each photo,
because apparently they have hierarchical tags and they don't have
a concept of separate categories which are not tags.

Fixes #219

Signed-off-by: Matěj Cepl <mc...@redhat.com>
---
jbrout/jbrout/winshow.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/jbrout/jbrout/winshow.py b/jbrout/jbrout/winshow.py
index ae43f2d..9ac15f1 100755
--- a/jbrout/jbrout/winshow.py
+++ b/jbrout/jbrout/winshow.py
@@ -31,6 +31,7 @@ class TagList(gtk.VBox):
#self.b.set_label("Test bouton")
gtk.VBox.__init__(self)
self.__callbackRemove = callbackRemove
+ # getAllTags returns list of tuples (tag, parent catg)
self.__tags = dict(JBrout.tags.getAllTags())

def fill(self, ll):
@@ -40,12 +41,17 @@ class TagList(gtk.VBox):

def __refresh(self):
l = self.get_children()
+ valid_tags = self.__tags.keys()
+
for a in l:
a.destroy()
del a

for i in self.__ll:
-
+ # we should filter out Categories ... some other programs, e.g.
+ # Shotwell, add these among Tags of the photo
+ if i not in valid_tags:
+ continue
hb = gtk.HBox()
lbl = gtk.Label()
lbl.set_label("%s (%s)" % (i, self.__tags[i]))
--
1.8.4.rc4

Francois Chartier

unread,
Sep 1, 2013, 6:30:03 AM9/1/13
to jbr...@googlegroups.com
But won't this block the import of new tags in jbrout ? (no try, just a reaction reading the mail)

Francois
--
You received this message because you are subscribed to the Google Groups "jBrout" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbrout+un...@googlegroups.com.
To post to this group, send email to jbr...@googlegroups.com.
Visit this group at http://groups.google.com/group/jbrout.
For more options, visit https://groups.google.com/groups/opt_out.

Matěj Cepl

unread,
Sep 11, 2013, 11:15:02 AM9/11/13
to jbr...@googlegroups.com
On 09/01/2013 12:30 PM, Francois Chartier wrote:
> But won't this block the import of new tags in jbrout ? (no try, just a
> reaction reading the mail)

How come? This is in winshow.TagList.__refresh which I hope is shown
just for display, isn't it?

Matěj

--
http://www.ceplovi.cz/matej/, Jabber: mc...@ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC

understand, v.:
To reach a point, in your investigation of some subject, at
which you cease to examine what is really present, and
operate on the basis of your own internal model instead.

signature.asc

Matěj Cepl

unread,
Sep 11, 2013, 6:24:38 PM9/11/13
to jbr...@googlegroups.com
On 09/11/2013 05:15 PM, Matěj Cepl wrote:
> On 09/01/2013 12:30 PM, Francois Chartier wrote:
>> But won't this block the import of new tags in jbrout ? (no try, just a
>> reaction reading the mail)
>
> How come? This is in winshow.TagList.__refresh which I hope is shown
> just for display, isn't it?

Actually, thinking about that, I have come with a bit more elegant patch
(see attached).

What do you'all think about it?

Best,

Matěj

--
http://www.ceplovi.cz/matej/, Jabber: mc...@ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC

"Push to test." (click) "Release to detonate..."
-- from a bugzilla quip list
0001-Don-t-put-categories-into-tags-shown-in-full-screen-.patch
signature.asc

Matěj Cepl

unread,
Sep 11, 2013, 6:27:41 PM9/11/13
to jbr...@googlegroups.com
On 09/12/2013 12:24 AM, Matěj Cepl wrote:
> Actually, thinking about that, I have come with a bit more elegant patch
> (see attached).

And actually, it is still branch keyError-219 in
https://gitorious.org/jbrout/jbrout repo.

Matěj

--
http://www.ceplovi.cz/matej/, Jabber: mc...@ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC

Give a man a regular expression and he’ll match a string…
teach him to make his own regular expressions and you’ve got a man with
problems.
-- yakugo in http://regex.info/blog/2006-09-15/247#comment-3022

signature.asc

Matěj Cepl

unread,
Sep 16, 2013, 9:36:50 AM9/16/13
to jbr...@googlegroups.com
On 09/12/2013 12:24 AM, Matěj Cepl wrote:
> On 09/11/2013 05:15 PM, Matěj Cepl wrote:
>> On 09/01/2013 12:30 PM, Francois Chartier wrote:
>>> But won't this block the import of new tags in jbrout ? (no try, just a
>>> reaction reading the mail)
>>
>> How come? This is in winshow.TagList.__refresh which I hope is shown
>> just for display, isn't it?
>
> Actually, thinking about that, I have come with a bit more elegant patch
> (see attached).
>
> What do you'all think about it?

Unless somebody objects loudly to the end of this week, this patch will
go to the master (aka SVN trunk) this Friday.

Best,

Matěj

--
http://www.ceplovi.cz/matej/, Jabber: mc...@ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC

When you're happy that cut and paste actually works I think it's
a sign you've been using X-Windows for too long.
-- from /. discussion on poor integration between KDE and
GNOME

signature.asc

Matěj Cepl

unread,
Sep 22, 2013, 1:57:56 PM9/22/13
to jbr...@googlegroups.com
On Mon, Sep 16, 2013 at 03:36:50PM +0200, Matěj Cepl wrote:
>On 09/12/2013 12:24 AM, Matěj Cepl wrote:
>> On 09/11/2013 05:15 PM, Matěj Cepl wrote:
>>> On 09/01/2013 12:30 PM, Francois Chartier wrote:
>>>> But won't this block the import of new tags in jbrout ? (no try, just a
>>>> reaction reading the mail)
>>>
>>> How come? This is in winshow.TagList.__refresh which I hope is shown
>>> just for display, isn't it?
>>
>> Actually, thinking about that, I have come with a bit more elegant patch
>> (see attached).
>>
>> What do you'all think about it?
>
>Unless somebody objects loudly to the end of this week, this patch will
>go to the master (aka SVN trunk) this Friday.

Commited as r361.

Matěj

Francois Chartier

unread,
Feb 8, 2014, 9:36:37 AM2/8/14
to jbr...@googlegroups.com
Hello Matej,

It didn't have anything to do with imports, indeed :)

Anyway, I recently updated my copy of jbrout, and it seems the second patch filtering on categories instead of tags does the contrary of what was expected. I haven't used shotwell, and don't have categories in my pictures, so merely removing the "not" in "if i not in valid_categories:" might not do the trick, but it seems to work for me.

Opened issue 221  http://code.google.com/p/jbrout/issues/detail?id=221

Best regards,
François
Reply all
Reply to author
Forward
0 new messages