From 79d32ba04cf44b00e2e873d272127bb62dd57147 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 4 Feb 2010 19:38:10 +0100 Subject: some l18n fixes --- locale/de/LC_MESSAGES/pyLoadGui.mo | Bin 0 -> 375 bytes locale/en/LC_MESSAGES/pyLoadGui.mo | Bin 0 -> 375 bytes locale/fr/LC_MESSAGES/pyLoadGui.mo | Bin 0 -> 375 bytes pyLoadCore.py | 36 +++++++++++++++++++----------------- pyLoadGui.py | 24 +++++++++++------------- 5 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 locale/de/LC_MESSAGES/pyLoadGui.mo create mode 100644 locale/en/LC_MESSAGES/pyLoadGui.mo create mode 100644 locale/fr/LC_MESSAGES/pyLoadGui.mo diff --git a/locale/de/LC_MESSAGES/pyLoadGui.mo b/locale/de/LC_MESSAGES/pyLoadGui.mo new file mode 100644 index 000000000..1ae24953f Binary files /dev/null and b/locale/de/LC_MESSAGES/pyLoadGui.mo differ diff --git a/locale/en/LC_MESSAGES/pyLoadGui.mo b/locale/en/LC_MESSAGES/pyLoadGui.mo new file mode 100644 index 000000000..1ae24953f Binary files /dev/null and b/locale/en/LC_MESSAGES/pyLoadGui.mo differ diff --git a/locale/fr/LC_MESSAGES/pyLoadGui.mo b/locale/fr/LC_MESSAGES/pyLoadGui.mo new file mode 100644 index 000000000..1ae24953f Binary files /dev/null and b/locale/fr/LC_MESSAGES/pyLoadGui.mo differ diff --git a/pyLoadCore.py b/pyLoadCore.py index 453e2d56e..f85191ec4 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -40,11 +40,13 @@ from os.path import exists from os.path import join from re import sub import subprocess +import sys from sys import argv from sys import executable from sys import exit from sys import path from sys import stdout +from sys import version_info from tempfile import NamedTemporaryFile import thread import time @@ -53,13 +55,13 @@ from xmlrpclib import Binary from module.CaptchaManager import CaptchaManager from module.HookManager import HookManager +from module.PullEvents import PullManager from module.XMLConfigParser import XMLConfigParser from module.file_list import File_List from module.network.Request import Request import module.remote.SecureXMLRPCServer as Server from module.thread_list import Thread_List from module.web.ServerThread import WebServer -from module.PullEvents import PullManager class Core(object): """ pyLoad Core """ @@ -106,7 +108,7 @@ class Core(object): self.do_kill = False self.do_restart = False translation = gettext.translation("pyLoad", join(self.path, "locale"), languages=[self.config['general']['language']]) - translation.install(unicode=True) + translation.install(unicode=False if sys.getdefaultencoding() == "ascii" else True) self.check_install("Crypto", _("pycrypto to decode container files")) self.check_install("Image", _("Python Image Libary (PIL) for captha reading")) @@ -139,7 +141,7 @@ class Core(object): self.lastGuiConnected = 0 self.server_methods = ServerMethods(self) - self.file_list = File_List(self) + self.file_list = File_List(self) self.pullManager = PullManager(self) self.thread_list = Thread_List(self) self.captchaManager = CaptchaManager(self) @@ -577,20 +579,20 @@ class ServerMethods(): return True else: return False - - def get_events(self, uuid): - return self.core.pullManager.getEvents(uuid) - - def get_full_queue(self): - data = [] - for pack in self.core.file_list.data["queue"]: - p = {"data":pack.data, "children":[]} - for child in pack.files: - info = self.core.file_list.getFileInfo(child.id) - info["downloading"] = None - p["children"].append(info) - data.append(p) - return data + + def get_events(self, uuid): + return self.core.pullManager.getEvents(uuid) + + def get_full_queue(self): + data = [] + for pack in self.core.file_list.data["queue"]: + p = {"data":pack.data, "children":[]} + for child in pack.files: + info = self.core.file_list.getFileInfo(child.id) + info["downloading"] = None + p["children"].append(info) + data.append(p) + return data #def move_urls_up(self, ids): # for id in ids: diff --git a/pyLoadGui.py b/pyLoadGui.py index 068ee667e..59db137c4 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -19,25 +19,24 @@ @version: v0.3 """ +import gettext +from os.path import basename +from os.path import dirname +from os.path import join +import re import sys - -from time import sleep, time +from time import sleep +from uuid import uuid4 as uuid from PyQt4.QtCore import * from PyQt4.QtGui import * - -from uuid import uuid4 as uuid -import re -import gettext -from os.path import basename, dirname, join - +from module.gui.Collector import * from module.gui.ConnectionManager import * -from module.gui.connector import * from module.gui.MainWindow import * from module.gui.PWInputWindow import * from module.gui.Queue import * -from module.gui.Collector import * from module.gui.XMLParser import * +from module.gui.connector import * class main(QObject): def __init__(self): @@ -54,15 +53,14 @@ class main(QObject): """ self.parser = XMLParser("module/config/gui.xml", "module/config/gui_default.xml") langNode = self.parser.xml.elementsByTagName("language").item(0).toElement() - translation = gettext.translation("pyLoad", join(dirname(__file__), "locale"), languages=[str(langNode.text())]) - translation.install(unicode=True) + translation = gettext.translation("pyLoadGui", join(dirname(__file__), "locale"), languages=[str(langNode.text())]) + translation.install(unicode=False if sys.getdefaultencoding() == "ascii" else True) self.mainWindow = MainWindow() self.pwWindow = PWInputWindow() self.connWindow = ConnectionManager() self.connector = connector() self.mainloop = self.Loop(self) self.connectSignals() - self.checkClipboard = False default = self.refreshConnections() self.connData = None -- cgit v1.2.3