[Mumps2Py:] [171] added ability to blacklist all the routines listed in the scan for errors report , all at once rather than individually.

[ Thread Index | Date Index | More lists.mumps2py.org/discuss Archives ]


Revision: 171
Author:   pgallot
Date:     2008-03-12 16:44:24 +0000 (Wed, 12 Mar 2008)

Log Message:
-----------
added ability to blacklist all the routines listed in the scan for errors report, all at once rather than individually.

Modified Paths:
--------------
    trunk/mumps2py_ui.pyw


Modified: trunk/mumps2py_ui.pyw
===================================================================
--- trunk/mumps2py_ui.pyw	2008-03-12 15:40:20 UTC (rev 170)
+++ trunk/mumps2py_ui.pyw	2008-03-12 16:44:24 UTC (rev 171)
@@ -269,9 +269,23 @@
             self.message("blacklisting only works with an m2p file", "Sorry")
             return
 
-        mumps2py.add_m2p_filter_out_rule(self.current_file, mod_name)
+        mumps2py.add_m2p_filter_out_rule(self.current_file, mod_name + '$')
         self.message("blacklist rule for %s created" % mod_name)
 
+    def blacklist_mods(self, the_mod_name_list):
+        """blacklist the given list of routine in the m2p file"""
+        extension = os.path.splitext(self.current_file)[1]
+        if extension != ".m2p":
+            self.message("blacklisting only works with an m2p file", "Sorry")
+            return
+
+        for mod_name in the_mod_name_list:
+            mumps2py.add_m2p_filter_out_rule(self.current_file, mod_name + '$')
+
+        self.message("blacklist rules for %d routines created" %
+                     len(the_mod_name_list))
+
+        
     def parsegivenmodule(self, popup):
         """select the routine specified by the popup"""
         popup.destroy()
@@ -485,7 +499,7 @@
                 the_module.empty_tokenlist() # keep memory usage down
         finally:
             print time.time() - tstart, "seconds to parse %d routines" % \
-                  modcnt
+                  (modcnt + 1)
             fileinput.close()
             self.busy(False)
 
@@ -495,10 +509,17 @@
             return
 
         routines_list = [routine for routine, err in error_list]
+        r_name_list = [routine.mod_name for routine, err in error_list]
         rpt_window.tag_configure("_extract_", foreground = 'blue')
         rpt_window.tag_bind("_extract_", '<1>', lambda e, s = self, \
                             l = routines_list: s.extract_mods(l))
         rpt_window.insert(END, "**extract these routines**\n\n", "_extract_")
+
+        rpt_window.tag_configure("_blacklist_", foreground = 'blue')
+        rpt_window.tag_bind("_blacklist_", '<1>', lambda e, s = self, \
+                            l = r_name_list: s.blacklist_mods(l))
+        rpt_window.insert(END, "**blacklist these routines**\n\n", \
+                          "_blacklist_")
         
         for the_module, error in error_list:
             r_name = the_module.mod_name


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/