1

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:

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

2 Answers 2

1

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
1
  • That led me to solving my problem, thanks! Only to allow me to find another...
    – Sam Hewitt
    Jun 29, 2012 at 4:19
1

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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .