Mercurial > pyarq-presupuestos
comparison Gtk/importFiebdc.py @ 6:2fc6b47dbe70
rename module globals to globalVars
author | Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es> |
---|---|
date | Sat, 06 Nov 2010 22:33:32 +0100 |
parents | 6502bfdaa84d |
children | 0359329a1c26 |
comparison
equal
deleted
inserted
replaced
5:6502bfdaa84d | 6:2fc6b47dbe70 |
---|---|
30 import threading | 30 import threading |
31 gobject.threads_init() | 31 gobject.threads_init() |
32 | 32 |
33 # pyArq-Presupuestos Modules | 33 # pyArq-Presupuestos Modules |
34 from Generic import utils | 34 from Generic import utils |
35 from Generic import globals | 35 from Generic import globalVars |
36 from Generic import durusdatabase | 36 from Generic import durusdatabase |
37 import gui | 37 import gui |
38 | 38 |
39 class FileSelectionWindow(object): | 39 class FileSelectionWindow(object): |
40 """importFiebdc.FileSelectionWindow: | 40 """importFiebdc.FileSelectionWindow: |
92 action=gtk.FILE_CHOOSER_ACTION_OPEN, | 92 action=gtk.FILE_CHOOSER_ACTION_OPEN, |
93 buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, | 93 buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, |
94 gtk.STOCK_OPEN,gtk.RESPONSE_OK)) | 94 gtk.STOCK_OPEN,gtk.RESPONSE_OK)) |
95 self.__window.set_default_response(gtk.RESPONSE_OK) | 95 self.__window.set_default_response(gtk.RESPONSE_OK) |
96 if self.__filetype == "budget" or self.__filetype == "database": | 96 if self.__filetype == "budget" or self.__filetype == "database": |
97 self.__window.set_current_folder(globals.getHomePath("BUDGET")) | 97 self.__window.set_current_folder(globalVars.getHomePath("BUDGET")) |
98 else: # "durus" | 98 else: # "durus" |
99 self.__window.set_current_folder( | 99 self.__window.set_current_folder( |
100 globals.getHomePath("DURUS-DATABASE")) | 100 globalVars.getHomePath("DURUS-DATABASE")) |
101 if self.__window.run() == gtk.RESPONSE_OK: | 101 if self.__window.run() == gtk.RESPONSE_OK: |
102 self._openFile(self.__window.get_filename()) | 102 self._openFile(self.__window.get_filename()) |
103 self.__window.destroy() | 103 self.__window.destroy() |
104 | 104 |
105 def _launchProgressWindow(self, file): | 105 def _launchProgressWindow(self, file): |
221 self.__label = gtk.Label() | 221 self.__label = gtk.Label() |
222 self.__label.set_text(_("Time: 0s")) | 222 self.__label.set_text(_("Time: 0s")) |
223 self.__label.show() | 223 self.__label.show() |
224 _Vbox1.add(self.__label) | 224 _Vbox1.add(self.__label) |
225 self.__throbber = gtk.Image() | 225 self.__throbber = gtk.Image() |
226 self.__throbber.set_from_file(globals.getAppPath("THROBBER-ICON")) | 226 self.__throbber.set_from_file(globalVars.getAppPath("THROBBER-ICON")) |
227 _Vbox1.add(self.__throbber) | 227 _Vbox1.add(self.__throbber) |
228 self.__throbber.show() | 228 self.__throbber.show() |
229 self.__animation = gtk.gdk.PixbufAnimation(globals.getAppPath("THROBBER-GIF")) | 229 self.__animation = gtk.gdk.PixbufAnimation(globalVars.getAppPath("THROBBER-GIF")) |
230 _pixbuf = self.__throbber.get_pixbuf() | 230 _pixbuf = self.__throbber.get_pixbuf() |
231 self.__throbber.set_from_animation(self.__animation) | 231 self.__throbber.set_from_animation(self.__animation) |
232 _Hbox1 = gtk.HBox(False, 0) | 232 _Hbox1 = gtk.HBox(False, 0) |
233 _Vbox1.add(_Hbox1) | 233 _Vbox1.add(_Hbox1) |
234 _button1 = gtk.Button(_("Cancel")) | 234 _button1 = gtk.Button(_("Cancel")) |
429 if self.__filetype == "database": | 429 if self.__filetype == "database": |
430 self.saveDurusDatabase() | 430 self.saveDurusDatabase() |
431 self.clear() | 431 self.clear() |
432 | 432 |
433 def saveDurusDatabase(self): | 433 def saveDurusDatabase(self): |
434 _path = globals.getHomePath("DURUS-DATABASE") | 434 _path = globalVars.getHomePath("DURUS-DATABASE") |
435 _file_whit_path_bc3 = self.__budget.filename | 435 _file_whit_path_bc3 = self.__budget.filename |
436 _filename_bc3 = _file_whit_path_bc3.split("/")[-1] | 436 _filename_bc3 = _file_whit_path_bc3.split("/")[-1] |
437 _filename = _filename_bc3.split(".")[-2] | 437 _filename = _filename_bc3.split(".")[-2] |
438 _file = _path + _filename + ".durus" | 438 _file = _path + _filename + ".durus" |
439 print utils.mapping(_("Saving file: $1"), (_file,)) | 439 print utils.mapping(_("Saving file: $1"), (_file,)) |