Logo Search packages:      
Sourcecode: adacontrol version File versions  Download package

def adactl::on_GPS_start (   H  ) 

Hook on GPS start
   Initialization actions
   They are defined as a hook rather than directly in this file, because when this file
    is elaborated, the GPS context is not yet set (project variables for example)

Definition at line 494 of file adactl.py.

00494                     :
   """Hook on GPS start
      Initialization actions
      They are defined as a hook rather than directly in this file, because when this file
       is elaborated, the GPS context is not yet set (project variables for example)
   """
   global adactl_cats, previous_command, previous_locfile, DelTree_Menu\
             ,long_mess_str, long_mess_pat, short_mess_pat, rule_statistics_pat, message_statistics_pat

   # Global variables initialization
   adactl_cats      = sets.Set()
   previous_command = ""
   previous_locfile = ""

   #                  1    2     3      456        7                           8
   long_mess_str = r"^(.+):(\d+):(\d+): (((Found:)|(Error:|Parameter:|Syntax:))( .*?):.*)$"
   long_mess_pat = re.compile (long_mess_str)
   #                               1       2                                  3
   short_mess_pat = re.compile (r"^(\d+: )?(Found:|Error:|Parameter:|Syntax:) (.*)$")
   #                                    1     23                                     4
   rule_statistics_pat = re.compile (r"^(.*): ((Check: \d+, Search: \d+, Count: \d+)|(not triggered))$")
   #                                      1                  2
   message_statistics_pat = re.compile(r"^(Issued messages:) (.*)$")


   # We must define the buttons here in order to compute the place of the icons from
   # the GPS directory, but we cannot call GPS.Button(), because it does not allow
   # the declaration of an icon (hence we use parse_xml).
   GPS.parse_xml("""
   <button action='Check_Unknown_File'>
      <title>Launch AdaControl (rules file)</title>
      <pixmap>"""
              + GPS.get_system_dir()
              + """share/gps/plug-ins/adactl.gif</pixmap>
   </button>
   <button action='Check_Unknown_Ask'>
      <title>Launch AdaControl (interactive)</title>
      <pixmap>"""
              + GPS.get_system_dir()
              + """share/gps/plug-ins/adactl_ask.gif</pixmap>
   </button>
   """)

   # Create the Help/Adacontrol/Help rule menu
   GPS.Process (command_name()+" -h list", ".+", Add_Rule_Menu)

   # Create hook on preference changes, and keep the "Delete Tree" menu in it
   GPS.Hook("preferences_changed").add (on_pref_changed)
   DelTree_Menu = GPS.Menu.get ("AdaControl/Delete Tree Files")
   on_pref_changed (GPS.Hook("preferences_changed"))

################################################################


Generated by  Doxygen 1.6.0   Back to index