From 2bf3720040bf59a52e8c39c3a39c8f49fb2ae592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrer=20=C3=96zen?= Date: Tue, 4 Oct 2005 16:17:16 +0000 Subject: [PATCH] =?UTF-8?q?i18n=20tamam.=20iki=20eksik=20var:=201.=20setup?= =?UTF-8?q?.py=20i=C3=A7indeki=20k=C4=B1s=C4=B1m=20d=C3=BCzeltilmeli=20(bo?= =?UTF-8?q?=C5=9F=20bi=20zaman=C4=B1mda=20yap=C4=B1cam,=20bana=20b=C4=B1ra?= =?UTF-8?q?k=C4=B1n)=202.=20pisi=20i=C3=A7inde=20bi=C5=9Filer=20unicode=20?= =?UTF-8?q?stringleri=20basamad=C4=B1klar=C4=B1=20i=C3=A7in=20aptal=20pyth?= =?UTF-8?q?on=20hatalar=C4=B1=20=C3=A7=C4=B1k=C4=B1yor.=20ben=20sadece=20c?= =?UTF-8?q?li/=5F=5Finit=5F=5F=20i=C3=A7indeki=20ui'deki=20output'u=20d?= =?UTF-8?q?=C3=BCzelttim,=20bunun=20neden=20oldu=C4=9Funa=20bak=C4=B1p=20h?= =?UTF-8?q?allediverin.=20normalde=20her=20yerde=20unicode=20kullanabilmem?= =?UTF-8?q?iz=20laz=C4=B1m=20=C3=A7=C4=B1kt=C4=B1larda.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/api.py | 2 +- pisi/cli/__init__.py | 2 +- setup.py | 38 ++++++++++++++++++++++++++------------ 3 files changed, 28 insertions(+), 14 deletions(-) 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 + } + )