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'm trying to package an app to /opt, but when installed the app won't run and complains:

Traceback (most recent call last):
 File "/opt/extras.ubuntu.com/drawers/bin/drawers", line 45, in <module>
    import drawers
  File "/opt/extras.ubuntu.com/drawers/drawers/__init__.py", line 21, in <module>
    locale.bindtextdomain('drawers', '/opt/extras.ubuntu.com/drawers/share/locale')
NameError: name 'locale' is not defined

I can't figure out what I need to change. Is there a config file I need to alter?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

It seems to me that your application doesn't contain any internationalized strings (internationalized with gettext helper: _(). So no local is produced to the targeted system as there is nothing to translate!

See http://docs.python.org/library/gettext.html for my information on gettext frmo python.

If your application doesn't contain any strings that you present to the user, you can remove the locale.bindtextdomain command in drawers/init.py

share|improve this answer
    
Thanks for your help... There actually isn't locale.bindtext command in the quickly template. Just deleting these lines from init.py worked: import gettext from gettext import gettext as _ gettext.textdomain('drawers') Note that commenting them out isn't good enough, they get replaced with the actual locale command text when packaged via quickly package --extras (not regular package). –  Ian B. Jul 9 '12 at 15:31

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.