[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: geda_manager.git: branch: master updated (0f67788ff1ac8594de7dd3d44a79ade85ec39a39)



The branch, master has been updated
       via  0f67788ff1ac8594de7dd3d44a79ade85ec39a39 (commit)
      from  f0b5f1a92a70a526f6c791305f5a55412c05dfdb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/gedamanager.py |   33 +++++++++++++++++----------------
 src/utils.py       |   40 +++++++++++++++++++++++++---------------
 2 files changed, 42 insertions(+), 31 deletions(-)


=================
 Commit Messages
=================

commit 0f67788ff1ac8594de7dd3d44a79ade85ec39a39
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxxx>
Date:   Tue Dec 2 16:17:53 2008 -0800

    Routine checkin.

:100644 100644 912c02a... cc6a8ca... M	src/gedamanager.py
:100644 100644 11c33f4... 43e482e... M	src/utils.py

=========
 Changes
=========

commit 0f67788ff1ac8594de7dd3d44a79ade85ec39a39
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxxx>
Date:   Tue Dec 2 16:17:53 2008 -0800

    Routine checkin.

diff --git a/src/gedamanager.py b/src/gedamanager.py
index 912c02a..cc6a8ca 100644
--- a/src/gedamanager.py
+++ b/src/gedamanager.py
@@ -445,11 +445,10 @@ class gEDAManager:
         self.project.open(path)
         self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Project set to ' + self.project.name + '\n')
         self.dependencyloop.switch_projects()
-    
+
 
     def set_sources_tree_to_project(self):
         """ Method to set the tree to current project object. """
-        print 'set_sources_tree_to_project'
         self.sources.clear()
         if self.project.name != None:
             self.load_sources_tree()
@@ -458,7 +457,6 @@ class gEDAManager:
 
     def set_dependencies_tree_to_project(self):
         """ Method to set the tree to current project object. """
-
         self.dependencies.clear()
         if self.project.dependency_dict != None:
             self.depnum = 0
@@ -471,7 +469,6 @@ class gEDAManager:
 
     def set_dependencies_tree_to_new_project(self):
         """ Method to set the tree to newly created project object. """
-
         self.dependencyloop.switch_projects()
         self.dependencies.clear()
         # Parent Folder
@@ -491,7 +488,6 @@ class gEDAManager:
         """
         if self.sources != None:
             # Clear out the sources first
-            print 'load_sources_tree'
             self.sources.clear()
             print 'sources cleared'
             # Start adding data to the Model
@@ -508,26 +504,18 @@ class gEDAManager:
 
                     folder = root.split('/')[-1]
                     try:
-                        print "root node"
                         node = self.sources.append(dictionary[root], [image, folder, root])
-                        print "root node out"
                     except KeyError:
-                        print "folder node"
                         node = self.sources.append(None, [image, folder, root])
-                        print "folder node out"
                     for f in [name for dec,name in sorted((os.path.splitext(f)[1][1:],f) for f in files)]: # List expression sorts by file extension
                         if not f.endswith(('~','-')):
                             image = icon.load_icon(self.utils.load_image(f), 22, 0)
-                            print "node"
                             self.sources.append(node, [image, f, os.path.join(root, f)])
-                            print "node out"
                     for d in dirs:
                         dictionary[os.path.join(root, d)] = node
 
                 self.sources_tree.expand_all()
 
-            print 'leaving load_sources_tree'
-
         
 ##     def load_sources_tree(self, file_list, parent=None, parent_path=None):
 ##         """!
@@ -964,6 +952,8 @@ class gEDAManager:
             model, selection_iter = selection.get_selected()
             if isinstance(selection_iter, gtk.TreeIter):
                 self.newsource = model.get_value(selection_iter, 1)
+            else:
+                self.newsource = None
         
         def response_to_dialog(entry, dialog, response):
             dialog.response(response)
@@ -1022,7 +1012,7 @@ class gEDAManager:
         new_text = entry.get_text()
         dialog.destroy()
 
-        if new_text:
+        if new_text and self.newsource != None:
             # Get the selected_node for the folder to add to            
             selection = self.sources_tree.get_selection()
             model, selection_iter = selection.get_selected()
@@ -1037,6 +1027,16 @@ class gEDAManager:
             filename = new_text + '.' + ext
             self.utils.update_file_list(self, 3, filepath)
             self.utils.run_command(self, filepath, None, ext)
+        else:
+            dialog = gtk.MessageDialog(self.window,
+                                       (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT),
+                                       gtk.MESSAGE_INFO,
+                                       gtk.BUTTONS_OK,
+                                       gtk.STOCK_DIRECTORY)
+            dialog.set_markup('<b>Please enter text and/or make sure a file type is selected.</b>')
+            dialog.show()
+            response = dialog.run()
+            dialog.destroy()
             
 
     @exceptions
@@ -1145,8 +1145,9 @@ class gEDAManager:
         #self.sources.remove(selection_iter)
         self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\nDeleted ' + selected_node + '.\n')
         node = self.utils.get_filename_from_filepath(selected_node)
-        if node in self.project.dependency_dict and list(self.utils.flatten(self.project.file_list)).count(node) == 1:
-            del self.project.dependency_dict[node]
+        # Commented out till I know what I am doing with the dependencies
+        ## if node in self.project.dependency_dict and list(self.utils.flatten(self.project.file_list)).count(node) == 1:
+        ##     del self.project.dependency_dict[node]
         
 
     def cb_delete_folder(self, widget):
diff --git a/src/utils.py b/src/utils.py
index 11c33f4..43e482e 100644
--- a/src/utils.py
+++ b/src/utils.py
@@ -556,7 +556,7 @@ class Utils:
         self.run_command(g, selected_node, None, ext)
         
 
-    #@exceptions
+    @exceptions
     def cb_processes_row_activated(self, widget, path, view_column, gedamanager):
         """!
         Event occurs when 'row-activated' signal is emitted or a user double
@@ -580,7 +580,7 @@ class Utils:
             self.run_command(g, selected_node, highlighted_source)
 
         
-    #@exceptions
+    @exceptions
     def run_command(self, gedamanager, filepath, highlighted_source=None, ext=None):
         """!
         Method to run commands for 'Processes' and 'Sources'.
@@ -597,15 +597,18 @@ class Utils:
             os.chdir(filepath.rpartition('/')[0])
             if ext == 'sch' or ext == 'sym':
                 if g.tools['sch'] == None or g.tools['sch'].poll() == 0:
-                    g.tools['sch'] = Popen(['gschem', filepath], stdin=PIPE, stdout=PIPE)
+                    g.tools['sch'] = Popen(['gschem', filepath])
                 elif g.tools['sch'].poll() == None: # Process is still running
-                    try:
-                        st = os.stat(filepath)
-                    except IOError:
-                        print 'IOError'
-                    else:
-                        print 'file size:', st[ST_SIZE]
-                        print 'file modified:', st[ST_MTIME]
+                    # The code below is just some code to check when the file
+                    # was modified etc
+                    ## try:
+                    ##     st = os.stat(filepath)
+                    ## except IOError:
+                    ##     print 'IOError'
+                    ## else:
+                    ##     print 'file size:', st[ST_SIZE]
+                    ##     print 'file modified:', st[ST_MTIME]
+                    pass
             elif ext == 'pcb':
                 if g.tools['pcb'] == None or g.tools['pcb'].poll() == 0:
                     g.tools['pcb'] = Popen(['pcb', filepath])
@@ -630,31 +633,38 @@ class Utils:
                 
                 # Need to put some logic here to make sure it is a valid program
                 elif g.tools['editor'] != None: 
-                    g.tools['editor'] = Popen([g.settings.editor, filepath])
-
+                    Popen([g.settings.editor, filepath])
+                    
         else: # Processes
             os.chdir(highlighted_source.rpartition('/')[0])
             program = filepath            
             # Netlists
             if program in self.netlists: # use gnetlist
-                subproc = Popen(['gnetlist', '-v','-g',program,highlighted_source])
+                subproc = Popen(['gnetlist', '-v','-g',program,highlighted_source], stdout=PIPE)
+                g.output_textbuffer.insert(g.output_textiter, self.get_time() + ' and output from ' + program + ':\n' + subproc.communicate()[0] + '\n')
             elif program == 'ghdl-compile':
+                # TODO
                 pass
             elif program == 'ghdl-compile->gtkwave-simulate':
+                # TODO
                 pass
             elif program == 'icarus-compile':
+                # TODO
                 pass
             elif program == 'icarus-compile->gtkwave-simulate':
+                # TODO
                 #subproc = Popen([program, highlighted_source])
                 pass
             elif program == 'gattrib':
                 if g.tools['gattrib'] == None or g.tools['gattrib'].poll() == 0:
-                    g.tools['gattrib'] = Popen([program, highlighted_source])
+                    g.tools['gattrib'] = Popen([program, highlighted_source], stdout=PIPE)
+                    g.output_textbuffer.insert(g.output_textiter, self.get_time() + ' and output from ' + program + ':\n' + g.tools['gattrib'].communicate()[0] + '.\n')
                 elif g.tools['gattrib'].poll() == None: # Process is still running
                     pass
             elif program == 'gsymcheck':
                 arg = '-v ' + highlighted_source
-                subproc = Popen([program, arg])
+                subproc = Popen([program, arg], stdout=PIPE)
+                g.output_textbuffer.insert(g.output_textiter, self.get_time() + ' and output from ' + program + ':\n' + subproc.communicate()[0] + '.\n')
             elif program == 'gsch2pcb workflow':
                 self.gsch2pcb = Gsch2pcb(g, highlighted_source)
             elif program == 'Update PCB (gsch2pcb)':




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs