"Open with" phatch integration fails on several selected images

Bug #379280 reported by Stani
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Phatch
Fix Released
High
Stani

Bug Description

When using Nautilus "open with" phatch integration on several selected images, nothing happens.

The same operation on only one file works.

This also affects the Shutter applications that relies on this integration to interact with Phatch. See Bug #344547.

Revision history for this message
Stani (stani) wrote :

Thanks for reporting this bug.

Changed in phatch:
assignee: nobody → stani (stani)
importance: Undecided → High
status: New → Confirmed
Stani (stani)
Changed in phatch:
status: Confirmed → In Progress
Revision history for this message
Stani (stani) wrote :

This has been fixed upstream in bzr.

$ bzr diff
=== modified file 'phatch/app.py'
--- phatch/app.py 2009-05-14 22:36:43 +0000
+++ phatch/app.py 2009-05-25 14:22:50 +0000
@@ -23,7 +23,7 @@
 VERSION = "%(name)s %(version)s"%INFO

 def fix_path(path):
- if path[:7] == 'file://': return urllib.unquote(path[7:])
+ if path.startswith('file://'): return urllib.unquote(path[7:])
     return path

 def parse_locale(config_paths):
@@ -147,12 +147,12 @@
     from pyWx import gui
     gui.drop(actionlist=paths[0],paths=paths[1:],settings=settings)

-def ext(path):
- return os.path.splitext(path)[1].lower()
+def has_ext(path,ext):
+ return path.lower().endswith(ext)

 def _console(paths,settings):
     from console import console
- if paths and ext(paths[0]) == INFO['extension']:
+ if paths and has_ext(paths[0], INFO['extension']):
         console.main(actionlist=paths[0],paths=paths[1:],settings=settings)
     else:
         console.main(actionlist='',paths=paths,settings=settings)
@@ -169,7 +169,7 @@
     if settings['init_fonts']:
         _init_fonts()
         return
- if len(paths) == 1 and ext(paths[0])!= INFO['extension']:
+ if paths and not has_ext(paths[0], INFO['extension']):
         settings['droplet'] = True
         paths.insert(0,'recent')
     if settings['droplet']:

$ bzr commit -m "make Phatch work with several selected images"
Committing to: /home/stani/sync/python/phatch/trunk/
modified phatch/app.py
Committed revision 586.

@Fabian:
If you want this to work immediately, just copy app.py from here:
http://bazaar.launchpad.net/~stani/phatch/dev/annotate/head%3A/phatch/app.py

and overwrite your old app.py:
$ sudo cp app.py /usr/share/python-support/phatch/phatch/app.py

Changed in phatch:
status: In Progress → Fix Committed
Revision history for this message
Artur Chmarzyński (szamot83) wrote :

I've tried this fix, and this not work.
When I paste in console:
 phatch /home/jola/Obrazy/Allegro/obudowy/IMG_1704.JPG /home/jola/Obrazy/Allegro/obudowy/IMG_1705.JPG

I get:

Traceback (most recent call last):
  File "/usr/bin/phatch", line 13, in <module>
    from phatch.app import main
  File "/var/lib/python-support/python2.5/phatch/app.py", line 26
    - if path[:7] == 'file://': return urllib.unquote(path[7:])

When I integrate it with Thunar, I only can work on one picture. When I try to resize several pictures nothing is happening.

Best regards.
Sorry for my English

Revision history for this message
Stani (stani) wrote :

Thanks for reporting. I'll have a look.

summary: - "open with" phatch integration fails on several selected images
+ "Open with" phatch integration fails on several selected images
Changed in phatch:
status: Fix Committed → In Progress
Revision history for this message
Stani (stani) wrote :

I've tried it again and it works fine. Please try again with the latest version from my PPA:
https://launchpad.net/~stani/+archive/ppa

or from bazaar: bzr branch lp:phatch

Do not just apply the fix. That won't work!

Changed in phatch:
status: In Progress → Fix Committed
Revision history for this message
Artur Chmarzyński (szamot83) wrote :

Thank you Stani, this version work flawlessly.

Can I do polish translation for this app? I don't know anything about programming, but if you tell me how I'll do this.
I want to thank in this way.

Best regards.

Revision history for this message
Stani (stani) wrote :

You can just translate Polish here:
https://translations.launchpad.net/phatch/trunk/+pots/phatch/pl/+translate?show=untranslated

Let me know when you are ready by private mail ;-)

Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.