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

gEDA-cvs: geda_manager.git: branch: master updated (81e3f4a2b5353ee0fb2a32bf02d6f106dd4b2ad0)



The branch, master has been updated
       via  81e3f4a2b5353ee0fb2a32bf02d6f106dd4b2ad0 (commit)
      from  73d89440f9caa1a97e038a121bbc6070f6097489 (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            |   41 ++++++++++++++++-------------------------
 src/processdependencyevent.py |    8 ++++----
 src/project.py                |    2 --
 src/utils.py                  |   39 +++++++++++++++++++--------------------
 4 files changed, 39 insertions(+), 51 deletions(-)


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

commit 81e3f4a2b5353ee0fb2a32bf02d6f106dd4b2ad0
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxx>
Date:   Mon Aug 18 01:57:34 2008 -0700

    Added time to the error and output logging for more information for the user.
    Fixed some bugs.

:100644 100644 7f0bf5c... ee54744... M	src/gedamanager.py
:100644 100644 e0c7930... dc4d542... M	src/processdependencyevent.py
:100644 100644 98f449e... 4a2c634... M	src/project.py
:100644 100644 44c9d17... c159c31... M	src/utils.py

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

commit 81e3f4a2b5353ee0fb2a32bf02d6f106dd4b2ad0
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxx>
Date:   Mon Aug 18 01:57:34 2008 -0700

    Added time to the error and output logging for more information for the user.
    Fixed some bugs.

diff --git a/src/gedamanager.py b/src/gedamanager.py
index 7f0bf5c..ee54744 100644
--- a/src/gedamanager.py
+++ b/src/gedamanager.py
@@ -318,8 +318,8 @@ class gEDAManager:
         errors_pixbuf.set_from_pixbuf(errors_icon)
         notebook.set_tab_label(notebook.get_nth_page(2), errors_pixbuf)
 
-        self.output_textbuffer.insert(self.output_textiter, 'Output log:\n')
-        self.errors_textbuffer.insert(self.errors_textiter, 'Error log:\n')
+        self.output_textbuffer.insert(self.output_textiter, 'Output log--\n')
+        self.errors_textbuffer.insert(self.errors_textiter, 'Error log--\n')
 
         # Finally add data to the store
         self.set_sources_tree_to_project()
@@ -412,8 +412,7 @@ class gEDAManager:
         if not self.project.clean:
             self.project.save()
         self.project.open(path)
-        self.output_textbuffer.insert(self.output_textiter,
-                                      'Project set to: ' + self.project.name + '\n')        
+        self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Project set to ' + self.project.name + '\n')        
     
     def set_sources_tree_to_project(self):
         """ Method to set the tree to current project object. """
@@ -694,7 +693,7 @@ class gEDAManager:
         @param menuitem that threw the event.
         @param data optional to pass in.
         """
-        self.output_textbuffer.insert(self.output_textiter, 'Exiting gEDA Manager.\n')
+        self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Exiting gEDA Manager.\n')        
         self.project.save()
         self.save_settings()
         self.write_logs()
@@ -717,10 +716,7 @@ class gEDAManager:
         @param widget that threw the event.
         @param event that was thrown.
         """
-        if self.project.name != None:
-            self.output_textbuffer.insert(self.output_textiter, 'Project ' + self.project.name + ' closed')
-        else:
-            self.output_textbuffer.insert(self.output_textiter, 'Project closed\n')
+        self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Project closed.\n')                
         self.set_menu_defaults()
         self.set_sources_tree_to_project()
 
@@ -732,11 +728,10 @@ class gEDAManager:
         @param event that was thrown.
         """
         if self.project.name != None:
-            self.output_textbuffer.insert(self.output_textiter, 'Project ' + self.project.name + ' saved.\n')
+            self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Project ' + self.project.name + ' saved.\n')
         else:
-            self.output_textbuffer.insert(self.output_textiter, 'Project saved.\n')
+            self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Project saved.\n')            
         self.set_menu_defaults()
-#        self.set_sources_tree_to_project()
 
 
     def cb_project_opened(self, widget, event):
@@ -745,7 +740,7 @@ class gEDAManager:
         @param widget that threw the event.
         @param event that was thrown.
         """
-        self.output_textbuffer.insert(self.output_textiter, 'Project ' + self.project.name + ' opened.\n')        
+        self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Project ' + self.project.name + ' opened.\n')
         self.set_menu_defaults()
         self.set_sources_tree_to_project()
 
@@ -756,7 +751,7 @@ class gEDAManager:
         @param widget that threw the event.
         @param event that was thrown.
         """
-        self.output_textbuffer.insert(self.output_textiter, 'Project created: ' + self.project.name + '.\n')
+        self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\nProject ' + self.project.name + ' created.\n')  
         self.set_menu_defaults()
         self.set_sources_tree_to_new_project()
 
@@ -926,7 +921,6 @@ class gEDAManager:
         if response == gtk.RESPONSE_OK:
             filename = dialog.get_filename()
             name = self.utils.get_node_name(filename)
-            print 'name adding:', name
             self.utils.update_file_list(self, 0, filename)
             self.utils.add_to_dependency_dict(self, name)
         dialog.destroy()
@@ -1000,10 +994,9 @@ class gEDAManager:
                 if name not in files:
                     os.system('cp ' + new_file + ' ' + directory)
                     self.sources.append(row_iter, [image, name, path])
-                    self.output_textbuffer.insert(self.output_textiter, 'Added copy of source:' + new_file + ' to ' + directory + '.\n')
+                    self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + 'Added copy of source - ' + new_file + ' - to ' + directory + '.\n')
                 else:
-                    self.output_textbuffer.insert(self.output_textiter, name + ' is already present in the directory: ' + directory + '.\n')
-
+                    self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + name + ' is already present in the directory - ' + directory + '.\n')
                 # Add the new file as a dependency for the selected file
                 self.project.dependency_dict[selected_node].append((True, new_file))
         dialog.destroy()
@@ -1136,9 +1129,8 @@ class gEDAManager:
             model[(0)][2] = new_path
             model[(0,0)][1] = new_text + '.gm'
             model[(0,0)][2] = new_path + '/' + new_text + '.gm'
-            self.output_textbuffer.insert(self.output_textiter, 'Project changed from ' + old_path + ' to ' + new_path + '.\n')
+            self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\nProject changed from ' + old_path + ' to ' + new_path + '\n.')
             self.project.save()
-
         elif '.' in new_text and '.' in old_path:
             # File
             os.rename(old_path, new_path)
@@ -1146,8 +1138,7 @@ class gEDAManager:
             model[path][2] = new_path
             icon = gtk.IconTheme()
             model[path][0] = icon.load_icon(self.utils.icon_lut[self.utils.get_node_ext(new_text)], 22, 0)
-            self.output_textbuffer.insert(self.output_textiter, old_path + ' changed to ' + new_path + '.\n')
-
+            self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + old_path + ' changed to ' + new_path + '.\n')
         elif '.' in new_text and '.' not in old_path: # Folder being changed
             pass # don't allow it to change names
 
@@ -1157,12 +1148,12 @@ class gEDAManager:
         else:
             # Folder -- so image does not need to be changed
             if os.path.exists(new_path):
-                self.output_textbuffer.insert(self.output_textiter, 'Folder already exists with this name.  Cannot rename.\n')
+                self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\nFolder already exists with this name.  Cannot rename.\n')
                 return
             os.rename(old_path, new_path)
             model[path][1] = new_text
             model[path][2] = new_path
-            self.output_textbuffer.insert(self.output_textiter, old_path + ' changed to ' + new_path + '.\n')            
+            self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\n' + old_path + ' changed to ' + new_path + '.\n')
 
         self.utils.update_file_list(self) # update file list
 
@@ -1270,7 +1261,7 @@ class gEDAManager:
         Event handlder when the form is closed in any fashion.
         @param event that was thrown.
         """
-        self.output_textbuffer.insert(self.output_textiter, 'Exiting gEDA Manager.\n')        
+        self.output_textbuffer.insert(self.output_textiter, self.utils.get_time() + ':\nExiting gEDA Manager.\n')        
         self.project.save()
         self.save_settings()
         self.write_logs()
diff --git a/src/processdependencyevent.py b/src/processdependencyevent.py
index e0c7930..dc4d542 100644
--- a/src/processdependencyevent.py
+++ b/src/processdependencyevent.py
@@ -49,8 +49,8 @@ class ProcessDependencyEvent(ProcessEvent):
         project's filesystem.
         """
         # Call method to set the status of the dependent files recursively
-        print 'event:',event
-        print 'event.pathname:',event.pathname
-        if event.pathname in self.g.project.dependency_dict:
-            self.g.utils.update_dependency_dict(self.g.project.dependency_dict[event.pathname])
+        name = self.g.utils.get_node_name(event.pathname)
+        print 'name process_IN_MODIFY:',name
+        if name in self.g.project.dependency_dict:
+            self.g.utils.update_dependency_dict(self.g.project.dependency_dict[name])
 
diff --git a/src/project.py b/src/project.py
index 98f449e..4a2c634 100644
--- a/src/project.py
+++ b/src/project.py
@@ -126,8 +126,6 @@ class Project(gobject.GObject):
             self.clean = True
             if not silent:
                 self.emit('saved', True)
-        else:
-            self.emit('saved', False)
 
 
     def open(self, path):
diff --git a/src/utils.py b/src/utils.py
index 44c9d17..c159c31 100644
--- a/src/utils.py
+++ b/src/utils.py
@@ -23,7 +23,7 @@
 #Utility class for the gEDA Manager
 #@author Newell Jensen
 
-import os, pygtk, gtk, dbus
+import os, pygtk, gtk, dbus, time
 pygtk.require('2.0')
 from lib.decorators import exceptions
 from project import *
@@ -123,7 +123,11 @@ class Utils:
                          'net': 'application-x-pcb-netlist',
                          'exc': 'application-x-excellon',
                          'fp': 'application-x-pcb-footprint'}
-                         
+
+
+    def get_time(self):
+        """ Method returns a string of the current time. """
+        return time.asctime(time.localtime(time.time()))
 
     def get_node_name(self, path):
         """!
@@ -222,22 +226,20 @@ class Utils:
             if name not in files:
                 os.system('cp ' + filename + ' ' + selected_node)
                 g.sources.append(selection_iter, [image, name, path])
-                g.output_textbuffer.insert(g.output_textiter, 'Added copy of source:' + filename + ' to ' + selected_node + '.\n')
+                g.output_textbuffer.insert(g.output_textiter, self.get_time() + ':\n' + 'Added copy of source:' + filename + ' to ' + selected_node + '.\n')
                 if name not in g.project.dependency_dict:
                     g.project.dependency_dict[name] = []
             else:
-                g.output_textbuffer.insert(g.output_textiter, name + ' is already present in the directory: ' + selected_node + '.\n')
+                g.output_textbuffer.insert(g.output_textiter, self.get_time() + ':\n' + name + ' is already present in the directory: ' + selected_node + '.\n')
         elif index == 1:
             # Logic here to delete the selected file
             f = os.path.exists(selected_node)
             if f:
                 os.system('rm ' + selected_node)
                 g.sources.remove(selection_iter)
-                g.output_textbuffer.insert(g.output_textiter, 'Deleted: ' + selected_node + '.\n')
+                g.output_textbuffer.insert(g.output_textiter, self.get_time() + ':\n' + 'Deleted ' + selected_node + '.\n')
                 node = self.get_node_name(selected_node)
-                print 'node:', node
                 if node in g.project.dependency_dict:
-                    print 'deleting from dependency list: ', node
                     del g.project.dependency_dict[node]
         elif index == 2:
             # Logic here to delete the folder
@@ -245,7 +247,6 @@ class Utils:
             if f: # delete directory recursively
                 for f in os.listdir(selected_node):
                     if f in g.project.dependency_dict:
-                        print 'yes'
                         del g.project.dependency_dict[f]
                 os.system('rm -rf ' + selected_node)
                 g.sources.remove(selection_iter)
@@ -325,8 +326,6 @@ class Utils:
             # PCB
             image = icon.load_icon(self.icon_lut['g2p'], 22, 0)
             status_image = self.get_status_image(g, selected_node, 'pcb')
-            print 'selected_node:', selected_node
-            print 'status_image for pcb:',status_image
             g.processes.append(create_pcb, ['gsch2pcb', image, status_image])
 
             # Netlists
@@ -429,8 +428,9 @@ class Utils:
         selection = g.sources_tree.get_selection()
         model, selection_iter = selection.get_selected()
         highlighted_source = g.sources.get_value(selection_iter, 2)
-        if highlighted_source not in g.project.dependency_dict:
-            g.project.dependency_dict[highlighted_source] = []
+        name = self.get_node_name(highlighted_source)
+        if name not in g.project.dependency_dict:
+            g.project.dependency_dict[name] = []
         self.run_command(g, selected_node, highlighted_source)
 
         
@@ -504,18 +504,13 @@ class Utils:
             # Need to figure out if the program to run will produce files
             # and whether or not it is currently running (GUI only)
 
-            # If the program produces files or updates others I will need
-            # to makes sure that I handle the updates properly
-            print 'highlighted_source:',highlighted_source
-            print 'selected_node:',selected_node
-            print 'Running a process command'
-            
+
             # Netlists
             if selected_node in self.netlists: # use gnetlist
                 if selected_node == 'gnetlist':
                     return
-                cmd = '-v -g ' + selected_node + ' ' + highlighted_source
-                subproc = Popen(['gnetlist', cmd])
+                arg = '-v -g ' + selected_node + ' ' + highlighted_source
+                subproc = Popen(['gnetlist', arg])
             elif selected_node == 'ghdl-compile':
                 pass
             elif selected_node == 'ghdl-compile->gtkwave-simulate':
@@ -530,6 +525,9 @@ class Utils:
                     g.tools['gattrib'] = Popen([selected_node, highlighted_source])
                 elif g.tools['gattrib'].poll() == None: # Process is still running
                     pass
+            elif selected_node == 'gsymcheck':
+                arg = '-v ' + highlighted_source
+                subproc = Popen([selected_node, arg])
             else:
                 subproc = Popen([selected_node, highlighted_source])
                 
@@ -558,3 +556,4 @@ class Utils:
         if filename not in g.project.dependency_dict:
             g.project.dependency_dict[filename] = []
             print g.project.dependency_dict
+




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