scolasync.py
Aller à la documentation de ce fichier.
#!/usr/bin/python3
# $Id: scolasync.py 47 2011-06-13 10:20:14Z georgesk $
licence={}
licenceEn="""
scolasync version %s:
a program to manage file transfers between a computer and a collection
of USB sticks.
Copyright (C) 2010-2012 Georges Khaznadar <georgesk@ofset.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
licence['en']=licenceEn
licenceFr="""
scolasync version %s :
un programme pour gérer des transferts de fichiers entre un
ordinateur et une collection de clés USB.
Copyright (C) 2010-2012 Georges Khaznadar <georgesk@ofset.org>
Ce projet est un logiciel libre : vous pouvez le redistribuer, le
modifier selon les terme de la GPL (GNU Public License) dans les
termes de la Free Software Foundation concernant la version 3 ou
plus de la dite licence.
Ce programme est fait avec l'espoir qu'il sera utile mais SANS
AUCUNE GARANTIE. Lisez la licence pour plus de détails.
<http://www.gnu.org/licenses/>.
"""
licence['fr']=licenceFr
import getopt, os, sys
import sip
# pour éviter des erreurs à l'instanciation des QVariant
sip.setapi('QVariant', 1)
import debug
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
def run(debugger=False, callback=lambda x: print(x)):
from dbus.mainloop.pyqt5 import DBusQtMainLoop
DBusQtMainLoop(set_as_default=True)
app = QApplication(sys.argv)
locale = "%s" %QLocale.system().name()
qtTranslator = QTranslator()
if qtTranslator.load("qt_" + locale, "/usr/share/qt5/translations"):
# print "OK for qttranslator"
app.installTranslator(qtTranslator)
appTranslator = QTranslator()
for path in ["/usr/share/scolasync","."]:
langdir=os.path.join(path,"lang",locale+".qm")
b= appTranslator.load(langdir)
if b:
# print "installation du fichier de traduction", langdir
app.installTranslator(appTranslator)
break
import mainWindow
window = mainWindow.mainWindow(None,locale)
if debugger:
debug.button(window, callback)
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
# run(debugger=True, callback=debug.listePartitionsCochees)
run()
src.scolasync.run
def run(debugger=False, callback=lambda x:print(x))
Le lancement de l'application.
Definition: scolasync.py:145
QtCore
QtWidgets
src.mainWindow.mainWindow
defines the main window of the application.
Definition: mainWindow.py:64