← Back to team overview

gnome-zeitgeist team mailing list archive

[Merge] lp:~gnome-zeitgeist/gnome-activity-journal/new-ontology into lp:gnome-activity-journal

 

tehk has proposed merging lp:~gnome-zeitgeist/gnome-activity-journal/new-ontology into lp:gnome-activity-journal.

Requested reviews:
  GNOME Zeitgeist Team (gnome-zeitgeist)


Moved to the new ontology currently being used in zeitgeist trunk and what will be zeitgeist 0.3.4
-- 
https://code.launchpad.net/~gnome-zeitgeist/gnome-activity-journal/new-ontology/+merge/26361
Your team GNOME Zeitgeist Team is requested to review the proposed merge of lp:~gnome-zeitgeist/gnome-activity-journal/new-ontology into lp:gnome-activity-journal.
=== modified file 'gnome-activity-journal'
--- gnome-activity-journal	2010-05-04 05:27:03 +0000
+++ gnome-activity-journal	2010-05-29 02:21:25 +0000
@@ -33,8 +33,8 @@
 # this file residing in $prefix/bin, we expect to find the remaining code
 # in $prefix/share/gnome-activity-journal/.
 if os.path.basename(our_dir) == 'bin':
-	sys.path.insert(0, os.path.join(os.path.dirname(our_dir),
-		'share/gnome-activity-journal'))
+    sys.path.insert(0, os.path.join(os.path.dirname(our_dir),
+                                    'share/gnome-activity-journal'))
 
 # Check for critical modules from other repositories.
 # Support side-by-side or nested repositories during development.
@@ -79,8 +79,8 @@
 
 parser = optparse.OptionParser(version=config.VERSION)
 parser.add_option("--debug",
-    action = "store_true", default=False, dest="debug",
-    help = _("print additional debugging information"))
+                  action = "store_true", default=False, dest="debug",
+                  help = _("print additional debugging information"))
 options, arguments = parser.parse_args()
 
 try:

=== modified file 'src/activity_widgets.py'
--- src/activity_widgets.py	2010-05-12 06:05:57 +0000
+++ src/activity_widgets.py	2010-05-29 02:21:25 +0000
@@ -125,10 +125,10 @@
 
 class DayViewContainer(gtk.VBox):
     event_templates = (
-        Event.new_for_values(interpretation=Interpretation.VISIT_EVENT.uri),
         Event.new_for_values(interpretation=Interpretation.MODIFY_EVENT.uri),
         Event.new_for_values(interpretation=Interpretation.CREATE_EVENT.uri),
-        Event.new_for_values(interpretation=Interpretation.OPEN_EVENT.uri),
+        Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT.uri),
+        Event.new_for_values(interpretation=Interpretation.SEND_EVENT.uri),
     )
     def __init__(self):
         super(DayViewContainer, self).__init__()
@@ -675,10 +675,9 @@
     A container for three image views representing periods in time
     """
     event_templates = (
-            Event.new_for_values(interpretation=Interpretation.VISIT_EVENT.uri),
             Event.new_for_values(interpretation=Interpretation.MODIFY_EVENT.uri),
             Event.new_for_values(interpretation=Interpretation.CREATE_EVENT.uri),
-            Event.new_for_values(interpretation=Interpretation.OPEN_EVENT.uri),
+            Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT.uri),
         )
     def __init__(self):
         """Woo"""

=== modified file 'src/common.py'
--- src/common.py	2010-05-18 05:09:35 +0000
+++ src/common.py	2010-05-29 02:21:25 +0000
@@ -55,7 +55,7 @@
 except ImportError:
     chardet = None
 
-from config import get_data_path, get_icon_path
+from config import get_data_path, get_icon_path, INTERPRETATION_UNKNOWN, MANIFESTATION_UNKNOWN
 
 from zeitgeist.datamodel import Interpretation, Event
 
@@ -130,23 +130,23 @@
 
 FILETYPES = {
     Interpretation.VIDEO.uri : 0,
-    Interpretation.MUSIC.uri : 3,
+    Interpretation.AUDIO.uri : 3,
     Interpretation.DOCUMENT.uri : 12,
     Interpretation.IMAGE.uri : 15,
-    Interpretation.SOURCECODE.uri : 12,
-    Interpretation.UNKNOWN.uri : 21,
-    Interpretation.IM_MESSAGE.uri : 21,
+    Interpretation.SOURCE_CODE.uri : 12,
+    INTERPRETATION_UNKNOWN : 21,
+    Interpretation.IMMESSAGE.uri : 21,
     Interpretation.EMAIL.uri : 21
 }
 
 FILETYPESNAMES = {
     Interpretation.VIDEO.uri : _("Video"),
-    Interpretation.MUSIC.uri : _("Music"),
+    Interpretation.AUDIO.uri : _("Music"),
     Interpretation.DOCUMENT.uri : _("Document"),
     Interpretation.IMAGE.uri : _("Image"),
-    Interpretation.SOURCECODE.uri : _("Source Code"),
-    Interpretation.UNKNOWN.uri : _("Unknown"),
-    Interpretation.IM_MESSAGE.uri : _("IM Message"),
+    Interpretation.SOURCE_CODE.uri : _("Source Code"),
+    INTERPRETATION_UNKNOWN : _("Unknown"),
+    Interpretation.IMMESSAGE.uri : _("IM Message"),
     Interpretation.EMAIL.uri :_("Email"),
 
 }

=== modified file 'src/config.py'
--- src/config.py	2010-05-26 07:27:58 +0000
+++ src/config.py	2010-05-29 02:21:25 +0000
@@ -39,6 +39,9 @@
 from zeitgeist.datamodel import Event, Subject, Interpretation, Manifestation, \
     ResultType
 
+# Legacy issues
+INTERPRETATION_UNKNOWN = "" # "http://zeitgeist-project.com/schema/1.0/core#UnknownInterpretation";
+MANIFESTATION_UNKNOWN = "" # "http://zeitgeist-project.com/schema/1.0/core#UnknownManifestation";
 
 # Installation details
 BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
@@ -136,7 +139,10 @@
 class Source(object):
     """A source which is used for category creation and verb/description storage for a given interpretation"""
     def __init__(self, interpretation, icon, desc_sing, desc_pl):
-        self.name = interpretation.name
+        if not isinstance(interpretation, str):
+            self.name = interpretation.name
+        else:
+            self.name = interpretation
         self.icon = icon
         self._desc_sing = desc_sing
         self._desc_pl = desc_pl
@@ -231,11 +237,11 @@
 SUPPORTED_SOURCES = {
     # TODO: Move this into Zeitgeist's library, implemented properly
     Interpretation.VIDEO.uri: Source(Interpretation.VIDEO, "gnome-mime-video", _("Worked with a Video"), _("Worked with Videos")),
-    Interpretation.MUSIC.uri: Source(Interpretation.MUSIC, "gnome-mime-audio", _("Worked with Audio"), _("Worked with Audio")),
+    Interpretation.AUDIO.uri: Source(Interpretation.AUDIO, "gnome-mime-audio", _("Worked with Audio"), _("Worked with Audio")),
     Interpretation.IMAGE.uri: Source(Interpretation.IMAGE, "image", _("Worked with an Image"), _("Worked with Images")),
     Interpretation.DOCUMENT.uri: Source(Interpretation.DOCUMENT, "stock_new-presentation", _("Edited or Read Document"), _("Edited or Read Documents")),
-    Interpretation.SOURCECODE.uri: Source(Interpretation.SOURCECODE, "applications-development", _("Edited or Read Code"), _("Edited or Read Code")),
-    Interpretation.IM_MESSAGE.uri: Source(Interpretation.IM_MESSAGE, "applications-internet", _("Conversation"), _("Conversations")),
+    Interpretation.SOURCE_CODE.uri: Source(Interpretation.SOURCE_CODE, "applications-development", _("Edited or Read Code"), _("Edited or Read Code")),
+    Interpretation.IMMESSAGE.uri: Source(Interpretation.IMMESSAGE, "applications-internet", _("Conversation"), _("Conversations")),
     Interpretation.EMAIL.uri: Source(Interpretation.EMAIL, "applications-internet", _("Email"), _("Emails")),
-    Interpretation.UNKNOWN.uri: Source(Interpretation.UNKNOWN, "applications-other", _("Other Activity"), _("Other Activities")),
+    INTERPRETATION_UNKNOWN: Source("Unknown", "applications-other", _("Other Activity"), _("Other Activities")),
 }

=== modified file 'src/content_objects.py'
--- src/content_objects.py	2010-05-27 05:33:51 +0000
+++ src/content_objects.py	2010-05-29 02:21:25 +0000
@@ -395,17 +395,17 @@
             "event" : event
         }
         try: wrds["interpretation"] = Interpretation[event.interpretation]
-        except KeyError: wrds["interpretation"] = Interpretation.OPEN_EVENT
+        except KeyError: wrds["interpretation"] = Interpretation.ACCESS_EVENT
         try: wrds["subject_interpretation"] = Interpretation[event.subjects[0].interpretation]
-        except KeyError: wrds["subject_interpretation"] = Interpretation.UNKNOWN
+        except KeyError: wrds["subject_interpretation"] = Interpretation
         try:
             wrds["source"] = SUPPORTED_SOURCES[self.event.subjects[0].interpretation]
         except:
-            wrds["source"] = SUPPORTED_SOURCES[Interpretation.UNKNOWN.uri]
+            wrds["source"] = SUPPORTED_SOURCES[""]
         try:
             wrds["manifestation"] = Manifestation[event.manifestation]
         except:
-            wrds["manifestation"] = Manifestation.UNKNOWN
+            wrds["manifestation"] = Manifestation
         for name in self.fields_to_format:
             val = getattr(self, name)
             setattr(self, name, val.format(**wrds))
@@ -488,13 +488,13 @@
             self.wrds = wrds = {
             }
             try: wrds["interpretation"] = Interpretation[event.interpretation]
-            except KeyError: wrds["interpretation"] = Interpretation.OPEN_EVENT
+            except KeyError: wrds["interpretation"] = Interpretation.ACCESS_EVENT
             try: wrds["subject_interpretation"] = Interpretation[event.subjects[0].interpretation]
-            except KeyError: wrds["subject_interpretation"] = Interpretation.UNKNOWN
+            except KeyError: wrds["subject_interpretation"] = Interpretation
             try:
                 wrds["source"] = SUPPORTED_SOURCES[self.event.subjects[0].interpretation]
             except:
-                wrds["source"] = SUPPORTED_SOURCES[Interpretation.UNKNOWN.uri]
+                wrds["source"] = SUPPORTED_SOURCES[""]
 
         @CachedAttribute
         def text(self):
@@ -546,7 +546,7 @@
     @classmethod
     def use_class(cls, event):
         """ Used by the content object chooser to check if the content object will work for the event"""
-        if event.subjects[0].interpretation == Interpretation.IM_MESSAGE.uri:
+        if event.subjects[0].interpretation == Interpretation.IMMESSAGE.uri:
             return cls
         return False
 
@@ -735,7 +735,7 @@
             interpretation = self.event.subjects[0].interpretation
             if Interpretation.VIDEO.uri == interpretation:
                 event_mime = "video/mpeg"
-            elif Interpretation.MUSIC.uri == interpretation:
+            elif Interpretation.AUDIO.uri == interpretation:
                 event_mime = "audio/x-mpeg"
             else: event_mime = "audio/x-mpeg"
         return event_mime

=== modified file 'src/external.py'
--- src/external.py	2010-05-18 05:09:35 +0000
+++ src/external.py	2010-05-29 02:21:25 +0000
@@ -240,7 +240,7 @@
 
         def get_events(self):
             events = []
-            events.append(self._make_event(int(self.start_time), Interpretation.OPEN_EVENT.uri))
+            events.append(self._make_event(int(self.start_time), Interpretation.ACCESS_EVENT.uri))
             if self.end_time:
                 events.append(self._make_event(int(self.end_time), Interpretation.CLOSE_EVENT.uri))
             return events

=== modified file 'src/plugins/status_icon_plugin.py'
--- src/plugins/status_icon_plugin.py	2010-05-26 07:27:58 +0000
+++ src/plugins/status_icon_plugin.py	2010-05-29 02:21:25 +0000
@@ -100,24 +100,23 @@
     }
 
     event_templates = (
-        Event.new_for_values(interpretation=Interpretation.VISIT_EVENT.uri),
         Event.new_for_values(interpretation=Interpretation.MODIFY_EVENT.uri),
         Event.new_for_values(interpretation=Interpretation.CREATE_EVENT.uri),
-        Event.new_for_values(interpretation=Interpretation.OPEN_EVENT.uri),
+        Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT.uri),
     )
     day_connection_id = None
     day = None
 
     sources = (
         (Interpretation.VIDEO, "gnome-mime-video"),
-        (Interpretation.MUSIC, "gnome-mime-audio"),
+        (Interpretation.AUDIO, "gnome-mime-audio"),
         (Interpretation.IMAGE, "gnome-mime-image"),
         (Interpretation.DOCUMENT, "x-office-document"),
-        (Interpretation.SOURCECODE, "gnome-mime-text"),
-        (Interpretation.IM_MESSAGE, "empathy"),
+        (Interpretation.SOURCE_CODE, "gnome-mime-text"),
+        (Interpretation.IMMESSAGE, "empathy"),
         (Interpretation.EMAIL, "email"),
-        (Interpretation.UNKNOWN, "gnome-other"),
-        (Manifestation.WEB_HISTORY, "text-html"),
+        ("Unknown", "gnome-other"),
+        (Interpretation.WEBSITE, "text-html"),
         )
 
     def __init__(self):
@@ -127,10 +126,12 @@
         self.quit_button = gtk.ImageMenuItem(stock_id=gtk.STOCK_QUIT)
         self.kept_members = [LabelSeparatorMenuItem(_("Recently Used")), LabelSeparatorMenuItem(_("Most Used"))]
         for symbol, icon_name in self.sources:
-            menu = gtk.ImageMenuItem(symbol.display_name)
+            menu = gtk.ImageMenuItem(symbol.display_name if not isinstance(symbol, str) else symbol)
             image = gtk.image_new_from_icon_name(icon_name, 24)
             image.show_all()
             menu.set_image(image)
+            if isinstance(symbol, str):
+                continue
             if symbol.uri in Interpretation:
                 templates = [Event.new_for_values(subject_interpretation=symbol.uri)]
             elif symbol.uri in Manifestation:

=== modified file 'src/store.py'
--- src/store.py	2010-05-27 05:39:18 +0000
+++ src/store.py	2010-05-29 02:21:25 +0000
@@ -55,10 +55,10 @@
         if len(uris) > 0:
             for i, uri in enumerate(uris):
                 templates += [
-                        Event.new_for_values(interpretation=Interpretation.VISIT_EVENT.uri, subject_uri=uri),
+                        Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT.uri, subject_uri=uri),
                         Event.new_for_values(interpretation=Interpretation.MODIFY_EVENT.uri, subject_uri=uri),
                         Event.new_for_values(interpretation=Interpretation.CREATE_EVENT.uri, subject_uri=uri),
-                        Event.new_for_values(interpretation=Interpretation.OPEN_EVENT.uri, subject_uri=uri)
+                        Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT.uri, subject_uri=uri)
                     ]
             CLIENT.find_event_ids_for_templates(templates, _event_request_handler,
                                              [0, time.time()*1000], num_events=50000,
@@ -296,7 +296,7 @@
             uri = item.event.subjects[0].uri
             if not uri in results:
                 results[uri] = []
-            if not item.event.interpretation == Interpretation.CLOSE_EVENT.uri:
+            if not item.event.interpretation == Interpretation.LEAVE_EVENT.uri:
                 results[uri].append([item, 0])
             else:
                 if not len(results[uri]) == 0:
@@ -421,10 +421,10 @@
         Optionally calls func upon completion
         """
         event_templates = (
-            Event.new_for_values(interpretation=Interpretation.VISIT_EVENT.uri),
+            Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT.uri),
             Event.new_for_values(interpretation=Interpretation.MODIFY_EVENT.uri),
             Event.new_for_values(interpretation=Interpretation.CREATE_EVENT.uri),
-            Event.new_for_values(interpretation=Interpretation.OPEN_EVENT.uri),
+            Event.new_for_values(interpretation=Interpretation.ACCESS_EVENT.uri),
         )
         def callback(events):
             def _thread_fn(events):


Follow ups