Locale directory not found

Bug #908240 reported by David Caro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CLI Companion
Fix Released
High
David Caro

Bug Description

When executing clicompanion it tries to locate the locale bin, but it fails to do so because it uses the source folder or the same dir as the clicompanion binary is placed, instead of using the PATH environment variable.

 11 if (os.path.exists ('/usr/share/clicompanion/')):
 12 BASEDIR = '/usr/share/clicompanion/'
 13 print "using locale in system"
 14 else:
 15 BASEDIR = os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0])))
 16 print "using locale in source code folder"

I set it high because it will not start
$ clicompanion
using locale in source code folder
Traceback (most recent call last):
  File "/usr/local/bin/clicompanion", line 45, in <module>
    idioma = get_language()
  File "/usr/local/bin/clicompanion", line 37, in get_language
    traducidos = os.listdir(locale_dir)
OSError: [Errno 2] No existe el archivo o el directorio: '/usr/local/bin/locale'

$ which locale
/usr/bin/locale

Related branches

Revision history for this message
David Caro (dcaro) wrote :

Sorry, it looks for the locales folder, not the binary,.

The problem is that it is installed in /usr/local/share/clicompanion instead of /usr/share/clicompanion, so it does not find the sources folder nor the system locales folder.

I propose two things:
 - Looking for the correct installed directory
 - Showing a nicer and clearer message when not finding the locales folder

David

Revision history for this message
David Caro (dcaro) wrote :

Maybe we should use the feedesktop standards for XDG_DATA_DIRS?

http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html

It sounds ok for me.

David

David Caro (dcaro)
summary: - Locale binary not found
+ Locale directory not found
David Caro (dcaro)
description: updated
description: updated
description: updated
David Caro (dcaro)
Changed in clicompanion:
assignee: nobody → David Caro (dcaro)
status: New → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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