Browse Source

Minor fixes

avkonst 12 years ago
parent
commit
17aa4b01f3

+ 1 - 1
mainline/.project

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>plugins</name>
+	<name>Metrix++</name>
 	<comment></comment>
 	<projects>
 	</projects>

+ 2 - 2
mainline/.pydevproject

@@ -5,7 +5,7 @@
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/plugins</path>
-<path>/plugins/ext</path>
+<path>/Metrix++</path>
+<path>/Metrix++/ext</path>
 </pydev_pathproperty>
 </pydev_project>

+ 9 - 4
mainline/core/api.py

@@ -93,10 +93,15 @@ class Parent(object):
 
 class ExitError(Exception):
     def __init__(self, plugin, reason):
-        Exception.__init__(self, "Plugin '"
-                           + plugin.get_name()
-                           + "' requested abnormal termination: "
-                           + reason)
+        if plugin != None:
+            Exception.__init__(self, "Plugin '"
+                               + plugin.get_name()
+                               + "' requested abnormal termination: "
+                               + reason)
+        else:
+            Exception.__init__(self, "'Abnormal termination requested: "
+                               + reason)
+            
 
 def subscribe_by_parents_name(parent_name, child, callback_name='callback'):
     child.get_plugin_loader().get_plugin(parent_name).subscribe(child, callback_name)

+ 2 - 2
mainline/core/db/loader.py

@@ -601,14 +601,14 @@ class Loader(object):
             logging.warn("Removing existing file: " + dbfile)
             os.unlink(dbfile)
         if previous_db != None and os.path.exists(previous_db) == False:
-            raise core.api.ExitError(self, "Database file '" + previous_db + "'  does not exist")
+            raise core.api.ExitError(None, "Database file '" + previous_db + "'  does not exist")
 
         self.db.create(dbfile, clone_from=previous_db)
         
     def open_database(self, dbfile, read_only = True):
         self.db = core.db.sqlite.Database()
         if os.path.exists(dbfile) == False:
-            raise core.api.ExitError(self, "Database file '" + dbfile + "'  does not exist")
+            raise core.api.ExitError(None, "Database file '" + dbfile + "'  does not exist")
         self.db.connect(dbfile, read_only=read_only)
         
         for table in self.db.iterate_tables():

+ 0 - 8
mainline/ext/std/code/api.py

@@ -1,8 +0,0 @@
-'''
-Created on 12/02/2013
-
-@author: konstaa
-'''
-
-class ICode(object):
-    pass

+ 2 - 3
mainline/ext/std/code/cpp.py

@@ -219,9 +219,8 @@ class CppCodeParser(object):
                 if blocks[curblk]['indent_start'] == indent_current:
                     next_block = reset_next_block(m.end())
                     if curblk == 0:
-                        print data.get_path()
-                        print cursor_current + len(self.regex_ln.findall(text, cursor_last_pos, m.start()))
-                        logging.warning("Non-matching closing bracket '}' detected")
+                        logging.warning("Non-matching closing bracket '}' detected: " + data.get_path() + ":" +
+                                        str(cursor_current + len(self.regex_ln.findall(text, cursor_last_pos, m.start()))))
                         count_mismatched_brackets += 1
                         continue