Index: calculatorview/perspectives/calculator/__init__.py
===================================================================
--- calculatorview/perspectives/calculator/__init__.py	(revision 85a24d9fc0668bebd4141c0ae4a293aede591c0f)
+++ calculatorview/perspectives/calculator/__init__.py	(revision 6d4891903c99abb2165866455c2ba14f67d6293f)
@@ -5,4 +5,5 @@
 from distutils.filelist import findall
 
+N_DIR = 12
 def get_data_path(media):
     """
@@ -19,6 +20,8 @@
     path = os.path.dirname(__file__)
     #Look for maximum n_dir up of the current dir to find media
-    n_dir = 12
-    for i in range(n_dir):
+   
+    #for i in range(n_dir):
+    i = 0
+    while(i < N_DIR):
         path, _ = os.path.split(path)
         media_path = os.path.join(path, media)
@@ -28,4 +31,5 @@
                  return module_media_path
              return media_path
+        i += 1
    
     raise RuntimeError('Could not find calculator media files')
@@ -39,5 +43,5 @@
 
     """
-    data_files =[]
+    data_files = []
     path = get_data_path(media="media")
     for f in findall(path):
Index: calculatorview/perspectives/calculator/aperture_editor.py
===================================================================
--- calculatorview/perspectives/calculator/aperture_editor.py	(revision 6137b1500635c6fedd6d779d3ae59748933c5e73)
+++ calculatorview/perspectives/calculator/aperture_editor.py	(revision 6d4891903c99abb2165866455c2ba14f67d6293f)
@@ -19,9 +19,9 @@
     
 class ApertureDialog(wx.Dialog):
-    def __init__(self, parent=None, manager=None,aperture=None, *args, **kwds):
+    def __init__(self, parent=None, manager=None, aperture=None, *args, **kwds):
         """
         Dialog allows to enter values for aperture
         """
-        kwds['size'] =(PANEL_WIDTH, PANEL_HEIGHT)
+        kwds['size'] = (PANEL_WIDTH, PANEL_HEIGHT)
         kwds['title'] = "Aperture Editor"
         wx.Dialog.__init__(self, parent=parent, *args, **kwds)
@@ -40,6 +40,7 @@
         """
         self.main_sizer = wx.BoxSizer(wx.VERTICAL)
-        self.box_aperture = wx.StaticBox(self, -1,str("Aperture"))
-        self.boxsizer_aperture = wx.StaticBoxSizer(self.box_aperture, wx.VERTICAL)
+        self.box_aperture = wx.StaticBox(self, -1, str("Aperture"))
+        self.boxsizer_aperture = wx.StaticBoxSizer(self.box_aperture, 
+                                                   wx.VERTICAL)
        
         self.name_sizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -56,5 +57,6 @@
         #Aperture name [string]
         aperture_name_txt = wx.StaticText(self, -1, 'Aperture Name : ')  
-        self.aperture_name_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH*5, 20), style=0) 
+        self.aperture_name_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH*5, 20),
+                                              style=0) 
         self.name_sizer.AddMany([(aperture_name_txt, 0, wx.LEFT|wx.RIGHT, 10),
                                        (self.aperture_name_tcl, 0, wx.EXPAND)])
@@ -75,10 +77,12 @@
         #Aperture distance [float]
         distance_txt = wx.StaticText(self, -1, 'Distance:') 
-        self.distance_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0)   
+        self.distance_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
+                                        style=0)   
         distance_unit_txt = wx.StaticText(self, -1, 'Unit: ') 
-        self.distance_unit_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20),style=0)  
+        self.distance_unit_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20),
+                                             style=0)  
         self.distance_sizer.AddMany([(distance_txt, 0, wx.LEFT|wx.RIGHT, 10),
                                      (self.distance_tcl, 0, wx.LEFT, 10),
-                                     (distance_unit_txt, 0, wx.LEFT|wx.RIGHT, 10),
+                                (distance_unit_txt, 0,  wx.LEFT|wx.RIGHT, 10),
                                      (self.distance_unit_tcl, 0, wx.EXPAND)])  
     def _layout_size_name(self):
@@ -88,5 +92,6 @@
         # Size name [string]
         size_name_txt = wx.StaticText(self, -1, 'Size Name : ')  
-        self.size_name_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH*5, 20), style=0) 
+        self.size_name_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH*5, 20),
+                                          style=0) 
         self.size_name_sizer.AddMany([(size_name_txt, 0, wx.LEFT|wx.RIGHT, 10),
                                        (self.size_name_tcl, 0, wx.EXPAND)])
@@ -99,20 +104,25 @@
         aperture_size_txt = wx.StaticText(self, -1, 'Size:') 
         x_aperture_size_txt = wx.StaticText(self, -1, 'x = ')  
-        self.x_aperture_size_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0) 
+        self.x_aperture_size_tcl = wx.TextCtrl(self, -1, 
+                                               size=(_BOX_WIDTH,20), style=0) 
         y_aperture_size_txt = wx.StaticText(self, -1, 'y = ')  
-        self.y_aperture_size_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0) 
+        self.y_aperture_size_tcl = wx.TextCtrl(self, -1,
+                                                size=(_BOX_WIDTH,20), style=0) 
         z_aperture_size_txt = wx.StaticText(self, -1, 'z = ')  
-        self.z_aperture_size_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0)  
+        self.z_aperture_size_tcl = wx.TextCtrl(self, -1,
+                                                size=(_BOX_WIDTH,20), style=0)  
         aperture_size_unit_txt = wx.StaticText(self, -1, 'Unit: ') 
-        self.aperture_size_unit_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0)  
-        self.aperture_size_sizer.AddMany([(aperture_size_txt, 0, wx.LEFT|wx.RIGHT, 10),
+        self.aperture_size_unit_tcl = wx.TextCtrl(self, -1, 
+                                                size=(_BOX_WIDTH,20), style=0)  
+        self.aperture_size_sizer.AddMany([(aperture_size_txt,
+                                         0, wx.LEFT|wx.RIGHT, 10),
                                      (x_aperture_size_txt, 0, wx.LEFT, 17),
-                                     (self.x_aperture_size_tcl, 0, wx.RIGHT, 10),
+                                (self.x_aperture_size_tcl, 0, wx.RIGHT, 10),
                                      (y_aperture_size_txt, 0, wx.EXPAND),
-                                     (self.y_aperture_size_tcl, 0, wx.RIGHT, 10),
+                                (self.y_aperture_size_tcl, 0, wx.RIGHT, 10),
                                      (z_aperture_size_txt, 0, wx.EXPAND),
-                                     (self.z_aperture_size_tcl, 0, wx.RIGHT, 10),
+                                (self.z_aperture_size_tcl, 0, wx.RIGHT, 10),
                                      (aperture_size_unit_txt, 0, wx.EXPAND),
-                                     (self.aperture_size_unit_tcl, 0, wx.RIGHT, 10)])
+                            (self.aperture_size_unit_tcl, 0, wx.RIGHT, 10)])
         
     def _layout_button(self):  
@@ -132,5 +142,5 @@
                                    (self.bt_close, 0, wx.LEFT, 10)])
         
-    def _do_layout(self, data=None):
+    def _do_layout(self ):#, data=None):
         """
         Draw the current panel
@@ -224,5 +234,5 @@
         if self._aperture.name != name:
             self._notes += "Change sample 's "
-            self._notes += "name from %s to %s \n"%(self._aperture.name, name)
+            self._notes += "name from %s to %s \n"% (self._aperture.name, name)
             self._aperture.name = name
             
@@ -235,5 +245,5 @@
         self._aperture.type = type
         self._notes += " Change type from"
-        self._notes += " %s to %s \n"%(self._aperture.type, type)
+        self._notes += " %s to %s \n"% (self._aperture.type, type)
         
     def on_change_distance(self):
@@ -250,15 +260,16 @@
                 if self._aperture.distance != float(distance):
                     self._notes += "Change distance from "
-                    self._notes += "%s to %s \n"%(self._aperture.distance, distance)
+                    self._notes += "%s to %s \n"% (self._aperture.distance, 
+                                                  distance)
                     self._aperture.distance  = float(distance)
             else:
                 self._notes += "Error: Expected a float for distance  "
                 self._notes += "won't changes distance from "
-                self._notes += "%s to %s"%(self._aperture.distance, distance)
+                self._notes += "%s to %s"% (self._aperture.distance, distance)
         #change the distance unit
         unit = self.distance_unit_tcl.GetValue().lstrip().rstrip()
         if self._aperture.distance_unit != unit:
             self._notes += " Change distance 's unit from "
-            self._notes += "%s to %s"%(self._aperture.distance_unit, unit)
+            self._notes += "%s to %s"% (self._aperture.distance_unit, unit)
         
     def on_change_size_name(self):
@@ -270,5 +281,5 @@
         self._aperture.size_name = size_name
         self._notes += " Change size name from"
-        self._notes += " %s to %s \n"%(self._aperture.size_name, size_name)
+        self._notes += " %s to %s \n"% (self._aperture.size_name, size_name)
    
     def on_change_size(self):
@@ -284,10 +295,13 @@
                 if self._aperture.size.x != float(x_aperture_size) :
                     self._notes += "Change x of aperture size from "
-                    self._notes += "%s to %s \n"%(self._aperture.size.x, x_aperture_size)
+                    self._notes += "%s to %s \n"% (self._aperture.size.x,
+                                                   x_aperture_size)
                     self._aperture.aperture_size.x  = float(x_aperture_size)
             else:
-                self._notes += "Error: Expected a float for the aperture size 's x "
+                self._notes += "Error: Expected a"
+                self._notes += " float for the aperture size 's x "
                 self._notes += "won't changes x aperture size from "
-                self._notes += "%s to %s"%(self._aperture.size.x, x_aperture_size)
+                self._notes += "%s to %s"% (self._aperture.size.x, 
+                                           x_aperture_size)
         #Change y coordinate
         y_aperture_size = self.y_aperture_size_tcl.GetValue().lstrip().rstrip()
@@ -299,10 +313,13 @@
                 if self._aperture.size.y != float(y_aperture_size):
                     self._notes += "Change y of aperture size from "
-                    self._notes += "%s to %s \n"%(self._aperture.size.y, y_aperture_size)
+                    self._notes += "%s to %s \n"% (self._aperture.size.y,
+                                                   y_aperture_size)
                     self._aperture.size.y  = float(y_aperture_size)
             else:
-                self._notes += "Error: Expected a float for the aperture size's y "
+                self._notes += "Error: Expected a float for the"
+                self._notes += " aperture size's y "
                 self._notes += "won't changes y aperture size from "
-                self._notes += "%s to %s"%(self._aperture.size.y, y_aperture_size)
+                self._notes += "%s to %s"% (self._aperture.size.y,
+                                            y_aperture_size)
         #Change z coordinate
         z_aperture_size = self.z_aperture_size_tcl.GetValue().lstrip().rstrip()
@@ -314,5 +331,5 @@
                 if self._aperture.size.z != float(z_aperture_size):
                     self._notes += "Change z of aperture size from "
-                    self._notes += "%s to %s \n"%(self._aperture.size.z,
+                    self._notes += "%s to %s \n"% (self._aperture.size.z,
                                                    z_aperture_size)
                     self._aperture.size.z  = float(z_aperture_size)
@@ -320,10 +337,11 @@
                 self._notes += "Error: Expected a float for the offset 's x "
                 self._notes += "won't changes z aperture size from "
-                self._notes += "%s to %s"%(self._aperture.size.z, z_aperture_size)
+                self._notes += "%s to %s"% (self._aperture.size.z,
+                                            z_aperture_size)
         #change the aperture center unit
         unit = self.aperture_size_unit_tcl.GetValue().lstrip().rstrip()
         if self._aperture.size_unit != unit:
             self._notes += " Change aperture size's unit from "
-            self._notes += "%s to %s"%(self._aperture.size_unit, unit)
+            self._notes += "%s to %s"% (self._aperture.size_unit, unit)
             self._aperture.size_unit = unit
                  
@@ -340,5 +358,7 @@
         if self.manager is not None:
             self.manager.set_aperture(self._aperture)
-        
+        if event is not None:
+            event.Skip()
+            
     def on_click_cancel(self, event):
         """
@@ -349,6 +369,8 @@
         if self.manager is not None:
              self.manager.set_aperture(self._aperture)
+        if event is not None:
+            event.Skip()
  
-if __name__ =="__main__":
+if __name__ == "__main__":
    
     app  = wx.App()
@@ -357,6 +379,6 @@
     # Load data 
     from DataLoader.data_info import Aperture
-    aperture = Aperture()
-    dlg = ApertureDialog(aperture=aperture)
+    ap = Aperture()
+    dlg = ApertureDialog(aperture=ap)
     dlg.ShowModal()
     app.MainLoop()
