-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvote
More file actions
executable file
·60 lines (45 loc) · 1.64 KB
/
envote
File metadata and controls
executable file
·60 lines (45 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2011 David García Garzón
This file is part of enVote
enVote 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.
enVote 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/>.
"""
from envotelib.Envoter import Envoter
from PyQt4 import QtGui, QtCore
import sys
import os
if getattr(sys,"frozen",None) is True :
# using cx_Freeze.
# Undocumented but path can be found in sys.path[1], at least in version 4.2.3
installDir = sys.path[1]
else :
installDir = os.path.dirname(__file__)
version = file(os.path.join(installDir, "VERSION")).read().strip()
iconFile = os.path.join(installDir,"envote.png")
translationPrefix = os.path.join(installDir,"i18n","envote_")
dataPath = os.path.join(installDir,"data")
app = QtGui.QApplication(sys.argv)
locale = str(QtCore.QLocale.system().name())
translations = [
"qt_",
translationPrefix,
]
for translation in translations :
translator = QtCore.QTranslator()
translator.load(translation + locale)
app.installTranslator(translator)
window = Envoter(dataPath, version=version)
window.resize(800,600)
window.setWindowIcon(QtGui.QIcon(iconFile))
window.show()
sys.exit(app.exec_())