Commits

Daniel Poelzleithner committed c1d9bbf Merge

merge

Comments (0)

Files changed (2)

pida/core/languages.py

 
 from pida.core.document import Document
 
+from pida.core.projects import Project
 from pida.core.service import Service
 from pida.core.features import FeaturesConfig
 from pida.core.environment import opts
     """
     _unique_id = 0
     _project_path = None
+    _project = None
 
     @property
     def uniqueid(self):
             return None, None
         return get_relative_path(self._project_path, self.filename)
 
+    def _get_project(self):
+        # test if the path changed and forget the old project
+        if self._project and self._project.source_directory != self._project_path:
+            self._project = None
+        if self._project:
+            return self._project
+        if self._project_path:
+            self._project = Project(self._project_path)
+            return self._project
+
+    def _set_project(self, value):
+        pass
+    project = property(_get_project, _set_project)
+
 class ExternalProxy(object):
     """
     Base Class for all proxy objects.

pida/utils/completer.py

 
     def on_key_press_event(self, widget, event):
         if event.type == gtk.gdk.KEY_PRESS:
-            print "key_pressed ", event.keyval
+            #print "key_pressed ", event.keyval
             #tab 65289
             if event.keyval in self.accept_keys:
                 self._sig_clean("user-accept", self._filter)
             elif event.keyval == 65362: #key up
                 s = self._tree.get_selection()
                 it = s.get_selected()[1]
-                print it
                 if not it:
                     return True
                 path = self._model.get_path(it)
                 np = (path[0]-1,)
                 s.select_path(np)
                 self._tree.scroll_to_cell(np, use_align=False, row_align=0.0, col_align=0.0)
-                print self.filter
                 nt = self._model.get_value(self._model.get_iter(np), 1)
                 self._update_sel(nt)
                 return True