gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: jakarta-gump/python/gump view.py
Date Fri, 09 May 2003 13:02:02 GMT
nicolaken    2003/05/09 06:02:02

  Modified:    python/gump view.py
  Log:
  Adding buttons that update and output to xml.
  Not yet done the user-information part
  
  Revision  Changes    Path
  1.42      +66 -7     jakarta-gump/python/gump/view.py
  
  Index: view.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/view.py,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- view.py	9 May 2003 06:40:05 -0000	1.41
  +++ view.py	9 May 2003 13:02:02 -0000	1.42
  @@ -78,6 +78,7 @@
   from gump.conf import dir, default, handleArgv
   from gump.gen import xmlize
   from gump.model import Module, Project
  +from gump.update import update
   
   ###############################################################################
   # Initialize
  @@ -100,9 +101,11 @@
   
     # item IDs:
     menu_BACK=10001 
  -  menu_RUN=10002
  -  menu_CONSOLE=10003
  -  menu_HELP=10004
  +  menu_UPDATE=10002
  +  menu_GEN=10003
  +  menu_RUN=10004
  +  menu_CONSOLE=10005
  +  menu_HELP=10006
     
     # view
     frame=None
  @@ -134,7 +137,19 @@
                                        wxBitmap("gump/images/back.bmp",
                                                 wxBITMAP_TYPE_BMP),
                                        "Back")
  -      
  +  
  +    self.frame.toolbar.AddSeparator()
  +
  +    self.frame.toolbar.AddSimpleTool(self.menu_UPDATE,
  +                                     wxBitmap("gump/images/update.bmp",
  +                                              wxBITMAP_TYPE_BMP),
  +                                     "Update from VCS")
  +                                     
  +    self.frame.toolbar.AddSimpleTool(self.menu_GEN,
  +                                     wxBitmap("gump/images/gen.bmp",
  +                                              wxBITMAP_TYPE_BMP),
  +                                     "Generate XML merged descriptor")
  +                                     
       self.frame.toolbar.AddSimpleTool(self.menu_RUN,
                                        wxBitmap("gump/images/run.bmp",
                                                 wxBITMAP_TYPE_BMP),
  @@ -225,6 +240,8 @@
       EVT_KEY_UP(self, self.OnKeyUp)
   
       EVT_MENU(self, self.menu_BACK, self.backAction)
  +    EVT_MENU(self, self.menu_UPDATE,  self.updateAction )
  +    EVT_MENU(self, self.menu_GEN,  self.genAction )
       EVT_MENU(self, self.menu_RUN,  self.runAction )
       EVT_TOOL(self, self.menu_CONSOLE, self.consoleAction)
       #        EVT_TOOL(self, 50, self.OnToolClick)
  @@ -248,7 +265,9 @@
       self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_Normal)
       self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_Expanded)
       self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_SelectedExpanded)
  +    
       self.workspace = load(files[0])
  +    
       names=Module.list.keys()
       names.sort()
       for name in names:
  @@ -281,6 +300,21 @@
         self.history.pop()
         self.showProject(self.history[-1])
       
  +  # updates CVS
  +  def updateAction(self,event):
  +    print "INUPDATE "
  +    if self.history[-1]:
  +      project=self.history[-1].name 
  +    else:
  +       project='all'
  +    
  +    print "INUPDATE " + project
  +    updateThread(self.workspace,project).Start()
  +    
  +  # run the selected project xml gen
  +  def genAction(self,event):
  +    genThread(self.workspace).Start()
  +    
     # run the selected project
     def runAction(self,event):
       if not self.history: return
  @@ -587,7 +621,33 @@
           else:
               return None
   
  -
  +class genThread:
  +  def __init__(self,workspace):
  +    self.workspace=workspace
  +  def Start(self):
  +    self.running = 1
  +    thread.start_new_thread(self.Run,())
  +  def Stop(self):
  +    self.running = 0
  +  def Run(self):      
  +    f=open( default.merge, 'w')
  +    try:
  +      xmlize('workspace',self.workspace,f)
  +    finally:
  +      # Since we may exit via an exception, close fp explicitly.
  +      f.close()
  +
  +class updateThread:
  +  def __init__(self,workspace,project):
  +    self.workspace=workspace
  +    self.project=project
  +  def Start(self):
  +    self.running = 1
  +    thread.start_new_thread(self.Run,())
  +  def Stop(self):
  +    self.running = 0
  +  def Run(self):
  +    update(self.workspace,self.project)
   
   class compileThread:
     def __init__(self,project,view):
  @@ -621,8 +681,7 @@
   if __name__ == '__main__':
   
     # init logging and add specific Gui handler
  -  #logging.config.fileConfig("gump/logconf.ini")
  -  logging.basicConfig();
  +  logging.config.fileConfig("gump/logconf.ini")
     
     # load app
     app = gumpview(0)
  
  
  

Mime
View raw message