Index: fittingview/src/sans/perspectives/fitting/fitting.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitting.py	(revision 7b1ca974fd92da9d0ead56ca96eebdf53efe92e7)
+++ fittingview/src/sans/perspectives/fitting/fitting.py	(revision 5d1c1f400b7b591137fab18f8544efe0ba5d9e12)
@@ -219,10 +219,15 @@
         
         self.menu1.AppendSeparator()
-        self.id_editmodel = wx.NewId()
+        self.edit_model_menu = wx.Menu()
+        # Find and put files name in menu
+        try:
+            self.set_edit_menu(owner=owner)
+        except:
+            raise
+        
+        self.id_edit = wx.NewId()
         editmodel_help = "Edit cusomized model sample file" 
-        self.menu1.Append(self.id_editmodel, "Edit Custom Model", 
-                                   editmodel_help) 
-        wx.EVT_MENU(owner, self.id_editmodel,  self.edit_custom_model)
-        
+        self.menu1.AppendMenu(self.id_edit, "Edit Custom Model", 
+                              self.edit_model_menu, editmodel_help)
         #create  menubar items
         return [(self.menu1, self.sub_menu)]
@@ -232,10 +237,32 @@
         Get the python editor panel
         """
-        from editmodel import PyConsole
-        filename = os.path.join("plugins", "testmodel.py")
-        frame = PyConsole(parent=self.parent, filename=filename)
+        id = event.GetId()
+        label = self.edit_model_menu.GetLabel(id)
+        from sans.perspectives.calculator.pyconsole import PyConsole
+        filename = os.path.join(models.find_plugins_dir(), label)
+        frame = PyConsole(parent=self.parent, manager=self, panel= self.fit_panel,
+                          title='Custom Model Editor', filename=filename)
         self.put_icon(frame)
         frame.Show(True) 
         
+    def set_edit_menu(self, owner):    
+        """
+        Set list of the edit model menu labels
+        """
+        list_fnames = os.listdir(models.find_plugins_dir())
+        for item in list_fnames:
+            name = os.path.basename(item)
+            toks = os.path.splitext(name)
+            if toks[1]=='.py' and not toks[0]=='__init__':
+                has_file = False
+                for item in self.edit_model_menu.GetMenuItems():
+                    if name == self.edit_model_menu.GetLabel(item.GetId()):
+                        has_file = True
+                if not has_file:
+                    id = wx.NewId()
+                    self.edit_model_menu.Append(id, name) 
+                    wx.EVT_MENU(owner, id,  self.edit_custom_model)
+                    has_file = False
+
     def put_icon(self, frame):
         """
Index: fittingview/src/sans/perspectives/fitting/models.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/models.py	(revision 4ad076b534008e8f1faa2d8cc353c1a74b413607)
+++ fittingview/src/sans/perspectives/fitting/models.py	(revision 5d1c1f400b7b591137fab18f8544efe0ba5d9e12)
@@ -10,5 +10,5 @@
 import time
 import logging
-
+import py_compile
 from sans.guiframe.events import StatusEvent  
 # Explicitly import from the pluginmodel module so that py2exe
@@ -69,13 +69,8 @@
     return model
   
-  
-def _findModels(dir):
-    """
-    """
-    # List of plugin objects
-    plugins = {}
-    # Go through files in plug-in directory
-    #always recompile the folder plugin
-    import compileall
+def find_plugins_dir():
+    """
+    Find path of the plugins dir
+    """
     dir = os.path.abspath(PLUGIN_DIR)
     if not os.path.isdir(dir):
@@ -85,4 +80,37 @@
     if not os.path.isdir(dir):
         dir = os.path.join(os.path.dirname(os.path.sys.path[0]), PLUGIN_DIR)
+    return dir
+
+class ReportProblem:
+    def __nonzero__(self):
+        type, value, traceback = sys.exc_info()
+        if type is not None and issubclass(type, py_compile.PyCompileError):
+            print "Problem with", repr(value)
+            raise type, value, traceback
+        return 1
+    
+report_problem = ReportProblem()
+
+def compile_file(dir):
+    """
+    Compile a py file
+    """
+    try:
+        import compileall
+        compileall.compile_dir(dir=dir, ddir=dir, force=1, quiet=report_problem)
+    except:
+        type, value, traceback = sys.exc_info()
+        return value
+    return None
+
+def _findModels(dir):
+    """
+    """
+    # List of plugin objects
+    plugins = {}
+    # Go through files in plug-in directory
+    #always recompile the folder plugin
+    import compileall
+    dir = find_plugins_dir()
     if not os.path.isdir(dir):
         msg = "SansView couldn't locate Model plugin folder."
@@ -92,5 +120,5 @@
     else:
         log("looking for models in: %s" % str(dir))
-        compileall.compile_dir(dir=dir, ddir=dir, force=1, quiet=True)
+        compile_file(dir)
         logging.info("pluging model dir: %s\n" % str(dir))
     try:
@@ -438,5 +466,6 @@
         is_modified = False
         if os.path.isdir(PLUGIN_DIR):
-            temp =  os.path.getmtime(PLUGIN_DIR)
+            # getmtime doesn't seem to work well: use getatime
+            temp =  os.path.getatime(PLUGIN_DIR)
             if  self.last_time_dir_modified != temp:
                 is_modified = True
@@ -460,5 +489,6 @@
         else:
             return {}
-        
+    
+             
     def populate_menu(self, modelmenu, event_owner):
         """
