[chronojump] Open the file selection dialog in the firmware folder



commit b841ba614594849e4076358ad2d9c405d9a159e6
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Jun 16 21:29:04 2010 +0200

    Open the file selection dialog in the firmware folder

 .../chronopic-firmwarecord.in                      |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/chronopic-firmware/chronopic-firmwarecord/chronopic-firmwarecord.in b/chronopic-firmware/chronopic-firmwarecord/chronopic-firmwarecord.in
index 54504bb..2ddcbc7 100755
--- a/chronopic-firmware/chronopic-firmwarecord/chronopic-firmwarecord.in
+++ b/chronopic-firmware/chronopic-firmwarecord/chronopic-firmwarecord.in
@@ -28,9 +28,12 @@ import os
 import platform
 
 if platform.version() == 'Windows':
+    LIBDIR = os.path.abspath('..', 'lib')
+    DATADIR = os.path.abspath('..', 'share')
     sys.path = ['..'] + sys.path
 else:
     LIBDIR = '@expanded_libdir@'
+    DATADIR = '@expanded_datadir@'
     root = os.path.join(LIBDIR, 'chronojump', 'python')
     sys.path.insert(0, root)
 
@@ -189,7 +192,8 @@ class MyFrame(wx.Frame):
     def boton_abrir(self, event): # wxGlade: MyFrame.<event_handler>
        
         #-- Abrir un dialogo de busqueda de ficheros
-        filechooser = wx.FileDialog(self, "Load Firmware Hex", sys.path[0], wildcard = "*.hex;*.HEX")
+        filechooser = wx.FileDialog(self, "Load Firmware Hex",
+                                    '%s/chronojump/firmware' % DATADIR, wildcard = "*.hex;*.HEX")
 
         #-- Esperar a que el usuario seleccione el fichero
         opcion = filechooser.ShowModal()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]