aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-02-12 21:46:43 +0100
committerPapoteur <papoteur@mageialinux-online.org>2015-02-12 21:46:43 +0100
commit35867d7a9337cf7b3a2de9a0b6ae2f07bf0d36fb (patch)
treefeefcb7ca8326591e0645391eacc2b73cac038aa
parent27cc10f1a0e9ea9ec3a5596ef4525269312ed9a9 (diff)
downloadMageiaSync-35867d7a9337cf7b3a2de9a0b6ae2f07bf0d36fb.tar
MageiaSync-35867d7a9337cf7b3a2de9a0b6ae2f07bf0d36fb.tar.gz
MageiaSync-35867d7a9337cf7b3a2de9a0b6ae2f07bf0d36fb.tar.bz2
MageiaSync-35867d7a9337cf7b3a2de9a0b6ae2f07bf0d36fb.tar.xz
MageiaSync-35867d7a9337cf7b3a2de9a0b6ae2f07bf0d36fb.zip
update the location of qm files. Install them with setup.py
-rw-r--r--mageiaSync/mageiasync.py15
-rw-r--r--setup.py23
2 files changed, 17 insertions, 21 deletions
diff --git a/mageiaSync/mageiasync.py b/mageiaSync/mageiasync.py
index a9bca68..f201625 100644
--- a/mageiaSync/mageiasync.py
+++ b/mageiaSync/mageiasync.py
@@ -281,7 +281,7 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow):
self.location=self.pd.location.text()
params=QtCore.QSettings("Mageia","mageiaSync")
self.release= self.pd.release.currentText()
- #elf.destination=self.pd.selectDest.text()
+ self.destination=self.pd.selectDest.text()
self.bwl=self.pd.bwl.value()
params.setValue("release", self.release)
params.setValue("user",self.user)
@@ -325,8 +325,8 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow):
self.selectAllState=not self.selectAllState
def connectActions(self):
- self.actionQuit.triggered.connect(self.quitApp)
- self.quit.clicked.connect(self.quitApp)
+ self.actionQuit.triggered.connect(app.quit)
+ self.quit.clicked.connect(app.quit)
self.actionRename.triggered.connect(self.rename)
self.actionUpdate.triggered.connect(self.updateList)
self.actionCheck.triggered.connect(self.manualChecks)
@@ -392,7 +392,7 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow):
params.setValue("user",self.pd.user.text())
params.setValue("password",self.pd.password.text())
params.setValue("location",self.pd.location.text())
- params.setValue("destination",self.destination)
+ params.setValue("destination",self.pd.selectDest.text())
params.setValue("bwl",str(self.pd.bwl.value()))
self.prefsInit()
self.pd.close()
@@ -458,11 +458,6 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow):
self.listIsos.setEnabled(True)
self.selectAll.setEnabled(True)
- def quitApp(self):
- self.stopSync()
- app.closeAllWindows()
- self.fillList.quit()
- app.quit()
def main(self):
self.show()
@@ -483,7 +478,7 @@ if __name__=='__main__':
if qtTranslator.load("qt_" + locale,QLibraryInfo.location(QLibraryInfo.TranslationsPath)):
app.installTranslator(qtTranslator)
appTranslator = QtCore.QTranslator()
- if appTranslator.load("mageiaSync_" + locale,QLibraryInfo.location(QLibraryInfo.TranslationsPath)):
+ if appTranslator.load("mageiaSync_" + locale,'/usr/share/mageiasync/translations'):
app.installTranslator(appTranslator)
isosSync = IsosViewer()
isosSync.main()
diff --git a/setup.py b/setup.py
index 840d499..6b46bc7 100644
--- a/setup.py
+++ b/setup.py
@@ -1,18 +1,18 @@
from distutils.core import setup
-import os
+from distutils.command.build import build
+import os, glob
-LOCALE_DIR= '/usr/share/locale'
+LOCALE_DIR= '/usr/share/mageiasync/translations'
-locales = []
-if os.path.exists('po/locale'):
- for lang in os.listdir('po/locale'):
- locales.append(os.path.join(lang, 'LC_MESSAGES'))
+class BuildQm(build):
+ os.system('pylupdate5 mageiaSync.pro')
+ for ts in glob.glob('translations/*.ts'):
+ os.system('lrelease {0} -qm {1}'.format(ts, (ts[:-2]+'qm')))
data_files = [("share/applications/", ["share/applications/mageiasync.desktop"]),
- ("share/icons/hicolor/scalable/apps", ["share/icons/mageiasync.svg"])
- ] + [(os.path.join(LOCALE_DIR, locale),
- [os.path.join('po', 'locale', locale, 'mageiasync.mo')])
- for locale in locales]
+ ("share/icons/hicolor/scalable/apps", ["share/icons/mageiasync.svg"]),
+ ("share/mageiasync/",glob.glob('translations/*.qm')),
+ ]
setup(
name = 'mageiasync',
@@ -20,7 +20,7 @@ setup(
packages = ['mageiaSync'],
scripts = ['mageiasync'],
license = 'GNU General Public License v3 (GPLv3)',
- url = 'https://github.com/papoteur-mga/mageiaSync',
+ url = 'http://gitweb.mageia.org/qa/MageiaSync/',
description = 'This tool downloads ISO images from mirror or Mageia testing server.',
long_description = 'This tool uses rsync with a GUI',
platforms = ['Linux'],
@@ -29,5 +29,6 @@ setup(
maintainer = 'david_david',
maintainer_email = 'david.david@mageialinux-online.org',
data_files = data_files,
+ cmdclass = {'build_qm': BuildQm,},
)