Rename imports from sugar to sugar3
Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Sascha Silbe <silbe@activitycentral.com>
This commit is contained in:
@@ -20,24 +20,24 @@
|
||||
Each activity within the OLPC environment must provide two
|
||||
dbus services. The first, patterned after the
|
||||
|
||||
sugar.activity.activityfactory.ActivityFactory
|
||||
sugar3.activity.activityfactory.ActivityFactory
|
||||
|
||||
class is responsible for providing a "create" method which
|
||||
takes a small dictionary with values corresponding to a
|
||||
|
||||
sugar.activity.activityhandle.ActivityHandle
|
||||
sugar3.activity.activityhandle.ActivityHandle
|
||||
|
||||
describing an individual instance of the activity.
|
||||
|
||||
Each activity so registered is described by a
|
||||
|
||||
sugar.activity.bundle.Bundle
|
||||
sugar3.activity.bundle.Bundle
|
||||
|
||||
instance, which parses a specially formatted activity.info
|
||||
file (stored in the activity directory's ./activity
|
||||
subdirectory). The
|
||||
|
||||
sugar.activity.bundlebuilder
|
||||
sugar3.activity.bundlebuilder
|
||||
|
||||
module provides facilities for the standard setup.py module
|
||||
which produces and registers bundles from activity source
|
||||
@@ -47,7 +47,7 @@ Once instantiated by the ActivityFactory's create method,
|
||||
each activity must provide an introspection API patterned
|
||||
after the
|
||||
|
||||
sugar.activity.activityservice.ActivityService
|
||||
sugar3.activity.activityservice.ActivityService
|
||||
|
||||
class. This class allows for querying the ID of the root
|
||||
window, requesting sharing across the network, and basic
|
||||
|
||||
@@ -13,7 +13,7 @@ which class to start.
|
||||
For example the most minimal Activity:
|
||||
|
||||
|
||||
from sugar.activity import activity
|
||||
from sugar3.activity import activity
|
||||
|
||||
class ReadActivity(activity.Activity):
|
||||
pass
|
||||
@@ -71,20 +71,20 @@ from telepathy.constants import CONNECTION_HANDLE_TYPE_CONTACT
|
||||
from telepathy.constants import CONNECTION_HANDLE_TYPE_ROOM
|
||||
|
||||
from sugar import util
|
||||
from sugar.presence import presenceservice
|
||||
from sugar.activity.activityservice import ActivityService
|
||||
from sugar.activity.namingalert import NamingAlert
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.window import Window
|
||||
from sugar.graphics.alert import Alert
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.datastore import datastore
|
||||
from sugar.session import XSMPClient
|
||||
from sugar3.presence import presenceservice
|
||||
from sugar3.activity.activityservice import ActivityService
|
||||
from sugar3.activity.namingalert import NamingAlert
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.window import Window
|
||||
from sugar3.graphics.alert import Alert
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.datastore import datastore
|
||||
from sugar3.session import XSMPClient
|
||||
from sugar import wm
|
||||
|
||||
# support deprecated imports
|
||||
from sugar.activity.widgets import ActivityToolbar, EditToolbar
|
||||
from sugar.activity.widgets import ActivityToolbox
|
||||
from sugar3.activity.widgets import ActivityToolbar, EditToolbar
|
||||
from sugar3.activity.widgets import ActivityToolbox
|
||||
|
||||
|
||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||
@@ -196,7 +196,7 @@ class Activity(Window, gtk.Container):
|
||||
|
||||
Usually, you will also need the standard EditToolbar. This is the
|
||||
one which has the standard copy and paste buttons. You need to
|
||||
derive your own EditToolbar class from sugar.EditToolbar:
|
||||
derive your own EditToolbar class from sugar3.EditToolbar:
|
||||
class EditToolbar(activity.EditToolbar):
|
||||
...
|
||||
|
||||
@@ -231,7 +231,7 @@ class Activity(Window, gtk.Container):
|
||||
def __init__(self, handle, create_jobject=True):
|
||||
"""Initialise the Activity
|
||||
|
||||
handle -- sugar.activity.activityhandle.ActivityHandle
|
||||
handle -- sugar3.activity.activityhandle.ActivityHandle
|
||||
instance providing the activity id and access to the
|
||||
presence service which *may* provide sharing for this
|
||||
application
|
||||
@@ -729,7 +729,7 @@ class Activity(Window, gtk.Container):
|
||||
def get_shared_activity(self):
|
||||
"""Returns an instance of the shared Activity or None
|
||||
|
||||
The shared activity is of type sugar.presence.activity.Activity
|
||||
The shared activity is of type sugar3.presence.activity.Activity
|
||||
"""
|
||||
return self._shared_activity
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ import uuid
|
||||
import dbus
|
||||
import gobject
|
||||
|
||||
from sugar.activity.activityhandle import ActivityHandle
|
||||
from sugar3.activity.activityhandle import ActivityHandle
|
||||
from sugar import util
|
||||
from sugar import env
|
||||
from sugar.datastore import datastore
|
||||
from sugar3.datastore import datastore
|
||||
|
||||
from errno import EEXIST, ENOSPC
|
||||
|
||||
@@ -167,7 +167,7 @@ class ActivityCreationHandler(gobject.GObject):
|
||||
the activity to be created and the sharing
|
||||
service that may or may not be connected with it
|
||||
|
||||
sugar.activity.activityhandle.ActivityHandle instance
|
||||
sugar3.activity.activityhandle.ActivityHandle instance
|
||||
|
||||
calls the "create" method on the service for this
|
||||
particular activity type and registers the
|
||||
|
||||
@@ -39,7 +39,7 @@ class ActivityService(dbus.service.Object):
|
||||
def __init__(self, activity):
|
||||
"""Initialise the service for the given activity
|
||||
|
||||
activity -- sugar.activity.activity.Activity instance
|
||||
activity -- sugar3.activity.activity.Activity instance
|
||||
|
||||
Creates dbus services that use the instance's activity_id
|
||||
as discriminants among all active services
|
||||
|
||||
@@ -33,7 +33,7 @@ import logging
|
||||
from fnmatch import fnmatch
|
||||
|
||||
from sugar import env
|
||||
from sugar.bundle.activitybundle import ActivityBundle
|
||||
from sugar3.bundle.activitybundle import ActivityBundle
|
||||
|
||||
|
||||
IGNORE_DIRS = ['dist', '.git']
|
||||
|
||||
@@ -26,10 +26,10 @@ import dbus.service
|
||||
import dbus.glib
|
||||
|
||||
import sugar
|
||||
from sugar.activity import activityhandle
|
||||
from sugar.activity import i18n
|
||||
from sugar.bundle.activitybundle import ActivityBundle
|
||||
from sugar.graphics import style
|
||||
from sugar3.activity import activityhandle
|
||||
from sugar3.activity import i18n
|
||||
from sugar3.bundle.activitybundle import ActivityBundle
|
||||
from sugar3.graphics import style
|
||||
from sugar import logger
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ def main():
|
||||
locale_path = i18n.get_locale_path(bundle.get_bundle_id())
|
||||
|
||||
gettext.bindtextdomain(bundle.get_bundle_id(), locale_path)
|
||||
gettext.bindtextdomain('sugar-toolkit', sugar.locale_path)
|
||||
gettext.bindtextdomain('sugar-toolkit', sugar3.locale_path)
|
||||
gettext.textdomain(bundle.get_bundle_id())
|
||||
|
||||
splitted_module = args[0].rsplit('.', 1)
|
||||
|
||||
@@ -23,13 +23,13 @@ import gtk
|
||||
import gobject
|
||||
import gconf
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.graphics.xocolor import XoColor
|
||||
from sugar.graphics.icon import get_icon_file_name
|
||||
from sugar.graphics.toolbutton import ToolButton
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.graphics.xocolor import XoColor
|
||||
from sugar3.graphics.icon import get_icon_file_name
|
||||
from sugar3.graphics.toolbutton import ToolButton
|
||||
|
||||
from sugar.bundle.activitybundle import ActivityBundle
|
||||
from sugar3.bundle.activitybundle import ActivityBundle
|
||||
|
||||
|
||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||
|
||||
@@ -20,14 +20,14 @@ import gettext
|
||||
import gconf
|
||||
import logging
|
||||
|
||||
from sugar.graphics.toolbutton import ToolButton
|
||||
from sugar.graphics.toolbarbox import ToolbarButton
|
||||
from sugar.graphics.radiopalette import RadioPalette, RadioMenuButton
|
||||
from sugar.graphics.radiotoolbutton import RadioToolButton
|
||||
from sugar.graphics.toolbox import Toolbox
|
||||
from sugar.graphics.xocolor import XoColor
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.bundle.activitybundle import ActivityBundle
|
||||
from sugar3.graphics.toolbutton import ToolButton
|
||||
from sugar3.graphics.toolbarbox import ToolbarButton
|
||||
from sugar3.graphics.radiopalette import RadioPalette, RadioMenuButton
|
||||
from sugar3.graphics.radiotoolbutton import RadioToolButton
|
||||
from sugar3.graphics.toolbox import Toolbox
|
||||
from sugar3.graphics.xocolor import XoColor
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.bundle.activitybundle import ActivityBundle
|
||||
|
||||
|
||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||
@@ -40,7 +40,7 @@ def _create_activity_icon(metadata):
|
||||
client = gconf.client_get_default()
|
||||
color = XoColor(client.get_string('/desktop/sugar/user/color'))
|
||||
|
||||
from sugar.activity.activity import get_bundle_path
|
||||
from sugar3.activity.activity import get_bundle_path
|
||||
bundle = ActivityBundle(get_bundle_path())
|
||||
icon = Icon(file=bundle.get_icon(), xo_color=color)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user