diff --git a/pisi/api.py b/pisi/api.py index d316c4d7..27ea2777 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -20,7 +20,7 @@ if ver[0] <= 2 and ver[1] < 4: import gettext __trans = gettext.translation('pisi', fallback=True) -_ = __trans.lgettext +_ = __trans.ugettext import pisi diff --git a/pisi/cli/__init__.py b/pisi/cli/__init__.py index c6d9a732..a0d19292 100644 --- a/pisi/cli/__init__.py +++ b/pisi/cli/__init__.py @@ -34,7 +34,7 @@ class CLI(UI): super(CLI, self).__init__(show_debug, show_verbose) def output(self, str): - sys.stdout.write(str) + sys.stdout.write(str.encode("utf-8")) sys.stdout.flush() def info(self, msg, verbose = False, noln = False): diff --git a/setup.py b/setup.py index 22657d33..b0574c45 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,10 @@ # Install script for tengis. # +import os +import shutil from distutils.core import setup +from distutils.command.install import install PISI_VERSION = "0.1" @@ -38,16 +41,27 @@ def getVersion(): else: return PISI_VERSION +class InstallPisi(install): + def run(self): + #install.run(self) + # FIXME: refactor this into a generic i18n function + # and take po names and install dir from options + os.popen("msgfmt po/tr.po -o po/tr.mo") + shutil.copy("po/tr.mo", "/usr/share/locale/tr/LC_MESSAGES/pisi.mo") + setup(name="pisi", - version= getVersion(), - description="PISI (Packages Installed Successfully as Intended)", - long_description="PISI is the package management system of Pardus Linux.", - license="GNU GPL2", - author="Pardus Developers", - author_email="pisi@uludag.org.tr", - url="http://www.uludag.org.tr/eng/pisi/", - package_dir = {'': ''}, - packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'], - data_files = [ ('/usr/share/locale/tr/LC_MESSAGES', ['po/tr/pisi.mo'])], - scripts = ['pisi-cli'] - ) + version= getVersion(), + description="PISI (Packages Installed Successfully as Intended)", + long_description="PISI is the package management system of Pardus Linux.", + license="GNU GPL2", + author="Pardus Developers", + author_email="pisi@uludag.org.tr", + url="http://www.uludag.org.tr/eng/pisi/", + package_dir = {'': ''}, + packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'], + data_files = [ ('/usr/share/locale/tr/LC_MESSAGES', ['po/tr/pisi.mo'])], + scripts = ['pisi-cli'], + cmdclass = { + 'install' : InstallPisi + } + )