~ubuntu-branches/ubuntu/maverick/apturl/maverick-security

« back to all changes in this revision

Viewing changes to AptUrl/Helpers.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt, Harald Sitter, Michael Vogt
  • Date: 2009-09-18 09:46:29 UTC
  • Revision ID: james.westby@ubuntu.com-20090918094629-z8b3go5cms2y5pxz
Tags: 0.4.1ubuntu1
[ Harald Sitter ]
* Borrow encoding wrappers from GDebi to fix encodings in KDE UI

[ Michael Vogt ]
* AptUrl/gtk/GtkUI.py:
  - Use software-properites to enable componenents
* debian/control:
  - Remove dependency on gnome-app-install 
  - Add software-properties-gtk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# along with GDebi; if not, write to the Free Software
20
20
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
21
 
22
 
import gettext
23
22
import subprocess
24
23
 
25
 
def _(str):
26
 
    return utf8(gettext.gettext(str))
27
 
 
28
 
def _n(singular, plural, n):
29
 
    return utf8(gettext.ngettext(singular, plural, n))
30
 
 
31
 
def utf8(str):
32
 
    if isinstance(str, unicode):
33
 
        return str
34
 
    try:
35
 
        return unicode(str, 'UTF-8')
36
 
    except:
37
 
        # assume latin1 as fallback
38
 
        return unicode(str, 'latin1')
39
 
 
40
24
def get_dist():
41
25
    return subprocess.Popen(["lsb_release","-c","-s"],stdout=subprocess.PIPE).communicate()[0].strip()
42
26