[kupfer: 29/51] Port Core, Applications, Notes and Triggers



commit ada49421895778c29c658c0f4a80b7540a164f9e
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Jan 9 20:02:24 2010 +0100

    Port Core, Applications, Notes and Triggers

 kupfer/objects.py              |    1 -
 kupfer/plugin/applications.py  |    4 ++--
 kupfer/plugin/core/contents.py |    6 +++---
 kupfer/plugin/core/debug.py    |    8 ++++----
 kupfer/plugin/core/text.py     |    3 ++-
 kupfer/plugin/notes.py         |    6 +++---
 kupfer/plugin/triggers.py      |    5 +++--
 7 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/kupfer/objects.py b/kupfer/objects.py
index 8755c0f..16cb32c 100644
--- a/kupfer/objects.py
+++ b/kupfer/objects.py
@@ -1,4 +1,3 @@
 from kupfer.obj.base import *
 from kupfer.obj.objects import FileLeaf, AppLeaf, UrlLeaf, TextLeaf
 from kupfer.obj.objects import RunnableLeaf, SourceLeaf
-from kupfer.obj.apps import AppLeafContentMixin
diff --git a/kupfer/plugin/applications.py b/kupfer/plugin/applications.py
index 16b94e2..32006f8 100644
--- a/kupfer/plugin/applications.py
+++ b/kupfer/plugin/applications.py
@@ -2,8 +2,8 @@ import gio
 from gio import app_info_get_all
 from gio.unix import desktop_app_info_set_desktop_env
 
-from kupfer.objects import (Source, AppLeaf, Action, FileLeaf,
-		FilesystemWatchMixin, )
+from kupfer.objects import Action, Source, AppLeaf, FileLeaf
+from kupfer.obj.helplib import FilesystemWatchMixin
 from kupfer import config, utils, plugin_support
 
 __kupfer_name__ = _("Applications")
diff --git a/kupfer/plugin/core/contents.py b/kupfer/plugin/core/contents.py
index e384780..99d6f8d 100644
--- a/kupfer/plugin/core/contents.py
+++ b/kupfer/plugin/core/contents.py
@@ -1,8 +1,8 @@
 import gtk
 
-from kupfer.objects import Leaf, Action, Source
-from kupfer.objects import RunnableLeaf, AppLeafContentMixin
-from kupfer import objects, pretty
+from kupfer.objects import Source, RunnableLeaf
+from kupfer.obj.apps import AppLeafContentMixin
+from kupfer import pretty
 from kupfer import kupferui
 
 __kupfer_sources__ = ("KupferSource", )
diff --git a/kupfer/plugin/core/debug.py b/kupfer/plugin/core/debug.py
index c89bf07..e09f00b 100644
--- a/kupfer/plugin/core/debug.py
+++ b/kupfer/plugin/core/debug.py
@@ -5,9 +5,9 @@ These are not meant to be useful to "normal" users of Kupfer -- if they are,
 they can be tested here before they migrate to a fitting plugin.
 """
 
-from kupfer.objects import Action, Leaf, Source
-from kupfer.objects import ComposedLeaf
-from kupfer import objects
+from kupfer.obj.base import Action, Leaf, Source, InvalidLeafError
+from kupfer.obj.compose import ComposedLeaf
+from kupfer.obj import objects
 from kupfer import pretty
 
 __kupfer_sources__ = ()
@@ -38,7 +38,7 @@ class Rescan (Action):
 
 	def activate(self, leaf):
 		if not leaf.has_content():
-			raise objects.InvalidLeafError("Must have content")
+			raise InvalidLeafError("Must have content")
 		source = leaf.content_source()
 		source.get_leaves(force_update=True)
 
diff --git a/kupfer/plugin/core/text.py b/kupfer/plugin/core/text.py
index 7e9bf7b..f8da9c6 100644
--- a/kupfer/plugin/core/text.py
+++ b/kupfer/plugin/core/text.py
@@ -4,7 +4,8 @@ import urllib2
 
 import gobject
 
-from kupfer.objects import TextSource, TextLeaf, FileLeaf, UrlLeaf, OpenUrl
+from kupfer.objects import TextSource, TextLeaf, FileLeaf, UrlLeaf
+from kupfer.obj.objects import OpenUrl
 from kupfer import utils
 
 __kupfer_name__ = u"Free-text Queries"
diff --git a/kupfer/plugin/notes.py b/kupfer/plugin/notes.py
index b4d76be..4f83968 100644
--- a/kupfer/plugin/notes.py
+++ b/kupfer/plugin/notes.py
@@ -10,8 +10,8 @@ import xml.sax.saxutils
 import dbus
 import xdg.BaseDirectory as base
 
-from kupfer.objects import (Action, Source, Leaf, AppLeafContentMixin, TextLeaf,
-		PicklingHelperMixin, FilesystemWatchMixin, )
+from kupfer.objects import Action, Source, Leaf, TextLeaf
+from kupfer.obj.apps import ApplicationSource
 from kupfer import icons, plugin_support
 
 __kupfer_name__ = _("Notes")
@@ -190,7 +190,7 @@ class ClassProperty (property):
 	def __get__(self, cls, owner):
 		return self.fget.__get__(None, owner)()
 
-class NotesSource (AppLeafContentMixin, Source, FilesystemWatchMixin):
+class NotesSource (ApplicationSource):
 	def __init__(self):
 		Source.__init__(self, _("Notes"))
 		self._notes = []
diff --git a/kupfer/plugin/triggers.py b/kupfer/plugin/triggers.py
index f1cd244..5936885 100644
--- a/kupfer/plugin/triggers.py
+++ b/kupfer/plugin/triggers.py
@@ -1,8 +1,9 @@
 import gtk
 
 
-from kupfer.objects import Leaf, Action, Source, TextSource
-from kupfer.objects import ComposedLeaf, TextLeaf, RunnableLeaf
+from kupfer.obj.base import Action, Source, TextSource
+from kupfer.obj.objects import TextLeaf, RunnableLeaf
+from kupfer.obj.compose import ComposedLeaf
 from kupfer import puid
 
 from kupfer.ui import keybindings



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