Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've developed a program for the App Developer Showdown, with quickly, in python, and it works as expected when I package and install it normally -in /usr. However when packaged for installation in /opt it doesn't run -and I'm not getting (or can't find) an error message of any sort, as to what the problem might be. I was wondering if someone here has the answer.

The app does require root access -using gksudo- to function.

Application:

share|improve this question
    
Could you share your solution with how you got quickly to create the share/locale link? –  Ian B. Jul 9 '12 at 14:01
    
@user75704 The answer I added below should help you. –  Sam Hewitt Jul 12 '12 at 2:20
add comment

2 Answers 2

up vote 1 down vote accepted

If you remove the gksudo stuff in bin/aplomb you see the error message:

Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/aplomb/bin/aplomb", line 48, in <module>
    import aplomb
  File "/opt/extras.ubuntu.com/aplomb/aplomb/__init__.py", line 26, in <module>
    from aplomb import AplombWindow
  File "/opt/extras.ubuntu.com/aplomb/aplomb/AplombWindow.py", line 23, in <module>
    locale.bindtextdomain('aplomb', '/opt/extras.ubuntu.com/aplomb/share/locale')
NameError: name 'locale' is not defined
share|improve this answer
    
That led me to solving my problem, thanks! Only to allow me to find another... –  Sam Hewitt Jun 29 '12 at 4:19
add comment

Adding these lines to the necessary files should solve your locale problems.

import locale

TEXTDOMAIN = 'yourapp'
LOCALEDIR = '/opt/extras.ubuntu.com/yourapp/share/locale'
#LOCALEDIR = '/usr/yourapp/share/locale'
from locale import gettext as _
locale.bindtextdomain(TEXTDOMAIN, LOCALEDIR)
locale.textdomain(TEXTDOMAIN)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.