Mercurial > pyarq-presupuestos
annotate pyArq-Presupuestos.py @ 14:d9e718bdee41
pyArq-Presupuestos to pyArq-Presupuestos.py
author | Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es> |
---|---|
date | Sat, 01 Jan 2011 20:09:02 +0100 |
parents | pyArq-Presupuestos@2fc6b47dbe70 |
children | 2a13413dcc13 |
rev | line source |
---|---|
1
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
1 #!/usr/bin/python |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
3 ## File presupuestos.py |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
4 ## This file is part of pyArq-Presupuestos. |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
5 ## |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
6 ## Copyright (C) 2010 Miguel Ángel Bárcena Rodríguez |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
7 ## <miguelangel@obraencurso.es> |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
8 ## |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
9 ## pyArq-Presupuestos is free software: you can redistribute it and/or modify |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
10 ## it under the terms of the GNU General Public License as published by |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
11 ## the Free Software Foundation, either version 3 of the License, or |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
12 ## (at your option) any later version. |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
13 ## |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
14 ## pyArq-Presupuestos is distributed in the hope that it will be useful, |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
17 ## GNU General Public License for more details. |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
18 ## |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
19 ## You should have received a copy of the GNU General Public License |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
20 ## along with this program. If not, see <http://www.gnu.org/licenses/>. |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
21 |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
22 def _translate(): |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
23 """def translate() |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
24 |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
25 Translates the program using gettext module |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
26 """ |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
27 _app = "pyArq-Presupuestos" |
6
2fc6b47dbe70
rename module globals to globalVars
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
3
diff
changeset
|
28 _dir = globalVars.path["APPDATA"] + "/mo/" |
1
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
29 gettext.install(_app, _dir, unicode=1) |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
30 |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
31 def _run_gui(): |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
32 """def _run_gui |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
33 |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
34 Shows main window and starts the GTK+ event processing loop. |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
35 """ |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
36 _window = gui.MainWindow() |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
37 |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
38 # Run pyArq-Presupuestos |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
39 if __name__ == "__main__": |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
40 # Modules |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
41 import gettext |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
42 import sys |
6
2fc6b47dbe70
rename module globals to globalVars
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
3
diff
changeset
|
43 from Generic import globalVars |
1
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
44 # take path to find mo file |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
45 _path = sys.path[0] |
6
2fc6b47dbe70
rename module globals to globalVars
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
3
diff
changeset
|
46 globalVars.path["APPDATA"]= _path |
1
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
47 _translate() |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
48 from Gtk import gui |
2ac1551ad2ab
add code
Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
parents:
diff
changeset
|
49 _run_gui() |