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:
parent
000ed75cbe
commit
8f1a821d68
@ -1,10 +1,10 @@
|
|||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.radiopalette import RadioPalette, RadioMenuButton, \
|
from sugar3.graphics.radiopalette import RadioPalette, RadioMenuButton, \
|
||||||
RadioToolsButton
|
RadioToolsButton
|
||||||
from sugar.graphics.radiotoolbutton import RadioToolButton
|
from sugar3.graphics.radiotoolbutton import RadioToolButton
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
|
|
||||||
window = gtk.Window()
|
window = gtk.Window()
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton
|
from sugar3.graphics.toolbarbox import ToolbarBox, ToolbarButton
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
|
|
||||||
window = gtk.Window()
|
window = gtk.Window()
|
||||||
|
|
||||||
|
@ -20,24 +20,24 @@
|
|||||||
Each activity within the OLPC environment must provide two
|
Each activity within the OLPC environment must provide two
|
||||||
dbus services. The first, patterned after the
|
dbus services. The first, patterned after the
|
||||||
|
|
||||||
sugar.activity.activityfactory.ActivityFactory
|
sugar3.activity.activityfactory.ActivityFactory
|
||||||
|
|
||||||
class is responsible for providing a "create" method which
|
class is responsible for providing a "create" method which
|
||||||
takes a small dictionary with values corresponding to a
|
takes a small dictionary with values corresponding to a
|
||||||
|
|
||||||
sugar.activity.activityhandle.ActivityHandle
|
sugar3.activity.activityhandle.ActivityHandle
|
||||||
|
|
||||||
describing an individual instance of the activity.
|
describing an individual instance of the activity.
|
||||||
|
|
||||||
Each activity so registered is described by a
|
Each activity so registered is described by a
|
||||||
|
|
||||||
sugar.activity.bundle.Bundle
|
sugar3.activity.bundle.Bundle
|
||||||
|
|
||||||
instance, which parses a specially formatted activity.info
|
instance, which parses a specially formatted activity.info
|
||||||
file (stored in the activity directory's ./activity
|
file (stored in the activity directory's ./activity
|
||||||
subdirectory). The
|
subdirectory). The
|
||||||
|
|
||||||
sugar.activity.bundlebuilder
|
sugar3.activity.bundlebuilder
|
||||||
|
|
||||||
module provides facilities for the standard setup.py module
|
module provides facilities for the standard setup.py module
|
||||||
which produces and registers bundles from activity source
|
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
|
each activity must provide an introspection API patterned
|
||||||
after the
|
after the
|
||||||
|
|
||||||
sugar.activity.activityservice.ActivityService
|
sugar3.activity.activityservice.ActivityService
|
||||||
|
|
||||||
class. This class allows for querying the ID of the root
|
class. This class allows for querying the ID of the root
|
||||||
window, requesting sharing across the network, and basic
|
window, requesting sharing across the network, and basic
|
||||||
|
@ -13,7 +13,7 @@ which class to start.
|
|||||||
For example the most minimal Activity:
|
For example the most minimal Activity:
|
||||||
|
|
||||||
|
|
||||||
from sugar.activity import activity
|
from sugar3.activity import activity
|
||||||
|
|
||||||
class ReadActivity(activity.Activity):
|
class ReadActivity(activity.Activity):
|
||||||
pass
|
pass
|
||||||
@ -71,20 +71,20 @@ from telepathy.constants import CONNECTION_HANDLE_TYPE_CONTACT
|
|||||||
from telepathy.constants import CONNECTION_HANDLE_TYPE_ROOM
|
from telepathy.constants import CONNECTION_HANDLE_TYPE_ROOM
|
||||||
|
|
||||||
from sugar import util
|
from sugar import util
|
||||||
from sugar.presence import presenceservice
|
from sugar3.presence import presenceservice
|
||||||
from sugar.activity.activityservice import ActivityService
|
from sugar3.activity.activityservice import ActivityService
|
||||||
from sugar.activity.namingalert import NamingAlert
|
from sugar3.activity.namingalert import NamingAlert
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.window import Window
|
from sugar3.graphics.window import Window
|
||||||
from sugar.graphics.alert import Alert
|
from sugar3.graphics.alert import Alert
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.datastore import datastore
|
from sugar3.datastore import datastore
|
||||||
from sugar.session import XSMPClient
|
from sugar3.session import XSMPClient
|
||||||
from sugar import wm
|
from sugar import wm
|
||||||
|
|
||||||
# support deprecated imports
|
# support deprecated imports
|
||||||
from sugar.activity.widgets import ActivityToolbar, EditToolbar
|
from sugar3.activity.widgets import ActivityToolbar, EditToolbar
|
||||||
from sugar.activity.widgets import ActivityToolbox
|
from sugar3.activity.widgets import ActivityToolbox
|
||||||
|
|
||||||
|
|
||||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
_ = 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
|
Usually, you will also need the standard EditToolbar. This is the
|
||||||
one which has the standard copy and paste buttons. You need to
|
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):
|
class EditToolbar(activity.EditToolbar):
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ class Activity(Window, gtk.Container):
|
|||||||
def __init__(self, handle, create_jobject=True):
|
def __init__(self, handle, create_jobject=True):
|
||||||
"""Initialise the Activity
|
"""Initialise the Activity
|
||||||
|
|
||||||
handle -- sugar.activity.activityhandle.ActivityHandle
|
handle -- sugar3.activity.activityhandle.ActivityHandle
|
||||||
instance providing the activity id and access to the
|
instance providing the activity id and access to the
|
||||||
presence service which *may* provide sharing for this
|
presence service which *may* provide sharing for this
|
||||||
application
|
application
|
||||||
@ -729,7 +729,7 @@ class Activity(Window, gtk.Container):
|
|||||||
def get_shared_activity(self):
|
def get_shared_activity(self):
|
||||||
"""Returns an instance of the shared Activity or None
|
"""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
|
return self._shared_activity
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@ import uuid
|
|||||||
import dbus
|
import dbus
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar.activity.activityhandle import ActivityHandle
|
from sugar3.activity.activityhandle import ActivityHandle
|
||||||
from sugar import util
|
from sugar import util
|
||||||
from sugar import env
|
from sugar import env
|
||||||
from sugar.datastore import datastore
|
from sugar3.datastore import datastore
|
||||||
|
|
||||||
from errno import EEXIST, ENOSPC
|
from errno import EEXIST, ENOSPC
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ class ActivityCreationHandler(gobject.GObject):
|
|||||||
the activity to be created and the sharing
|
the activity to be created and the sharing
|
||||||
service that may or may not be connected with it
|
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
|
calls the "create" method on the service for this
|
||||||
particular activity type and registers the
|
particular activity type and registers the
|
||||||
|
@ -39,7 +39,7 @@ class ActivityService(dbus.service.Object):
|
|||||||
def __init__(self, activity):
|
def __init__(self, activity):
|
||||||
"""Initialise the service for the given 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
|
Creates dbus services that use the instance's activity_id
|
||||||
as discriminants among all active services
|
as discriminants among all active services
|
||||||
|
@ -33,7 +33,7 @@ import logging
|
|||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
|
|
||||||
from sugar import env
|
from sugar import env
|
||||||
from sugar.bundle.activitybundle import ActivityBundle
|
from sugar3.bundle.activitybundle import ActivityBundle
|
||||||
|
|
||||||
|
|
||||||
IGNORE_DIRS = ['dist', '.git']
|
IGNORE_DIRS = ['dist', '.git']
|
||||||
|
@ -26,10 +26,10 @@ import dbus.service
|
|||||||
import dbus.glib
|
import dbus.glib
|
||||||
|
|
||||||
import sugar
|
import sugar
|
||||||
from sugar.activity import activityhandle
|
from sugar3.activity import activityhandle
|
||||||
from sugar.activity import i18n
|
from sugar3.activity import i18n
|
||||||
from sugar.bundle.activitybundle import ActivityBundle
|
from sugar3.bundle.activitybundle import ActivityBundle
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar import logger
|
from sugar import logger
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ def main():
|
|||||||
locale_path = i18n.get_locale_path(bundle.get_bundle_id())
|
locale_path = i18n.get_locale_path(bundle.get_bundle_id())
|
||||||
|
|
||||||
gettext.bindtextdomain(bundle.get_bundle_id(), locale_path)
|
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())
|
gettext.textdomain(bundle.get_bundle_id())
|
||||||
|
|
||||||
splitted_module = args[0].rsplit('.', 1)
|
splitted_module = args[0].rsplit('.', 1)
|
||||||
|
@ -23,13 +23,13 @@ import gtk
|
|||||||
import gobject
|
import gobject
|
||||||
import gconf
|
import gconf
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.xocolor import XoColor
|
from sugar3.graphics.xocolor import XoColor
|
||||||
from sugar.graphics.icon import get_icon_file_name
|
from sugar3.graphics.icon import get_icon_file_name
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
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)
|
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||||
|
@ -20,14 +20,14 @@ import gettext
|
|||||||
import gconf
|
import gconf
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
from sugar.graphics.toolbarbox import ToolbarButton
|
from sugar3.graphics.toolbarbox import ToolbarButton
|
||||||
from sugar.graphics.radiopalette import RadioPalette, RadioMenuButton
|
from sugar3.graphics.radiopalette import RadioPalette, RadioMenuButton
|
||||||
from sugar.graphics.radiotoolbutton import RadioToolButton
|
from sugar3.graphics.radiotoolbutton import RadioToolButton
|
||||||
from sugar.graphics.toolbox import Toolbox
|
from sugar3.graphics.toolbox import Toolbox
|
||||||
from sugar.graphics.xocolor import XoColor
|
from sugar3.graphics.xocolor import XoColor
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.bundle.activitybundle import ActivityBundle
|
from sugar3.bundle.activitybundle import ActivityBundle
|
||||||
|
|
||||||
|
|
||||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||||
@ -40,7 +40,7 @@ def _create_activity_icon(metadata):
|
|||||||
client = gconf.client_get_default()
|
client = gconf.client_get_default()
|
||||||
color = XoColor(client.get_string('/desktop/sugar/user/color'))
|
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())
|
bundle = ActivityBundle(get_bundle_path())
|
||||||
icon = Icon(file=bundle.get_icon(), xo_color=color)
|
icon = Icon(file=bundle.get_icon(), xo_color=color)
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ import warnings
|
|||||||
|
|
||||||
from sugar import env
|
from sugar import env
|
||||||
from sugar import util
|
from sugar import util
|
||||||
from sugar.bundle.bundle import Bundle, \
|
from sugar3.bundle.bundle import Bundle, \
|
||||||
MalformedBundleException, NotInstalledException
|
MalformedBundleException, NotInstalledException
|
||||||
from sugar.bundle.bundleversion import NormalizedVersion
|
from sugar3.bundle.bundleversion import NormalizedVersion
|
||||||
from sugar.bundle.bundleversion import InvalidVersionError
|
from sugar3.bundle.bundleversion import InvalidVersionError
|
||||||
|
|
||||||
|
|
||||||
class ActivityBundle(Bundle):
|
class ActivityBundle(Bundle):
|
||||||
|
@ -26,11 +26,11 @@ import os
|
|||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from sugar import env
|
from sugar import env
|
||||||
from sugar.bundle.bundle import Bundle, NotInstalledException, \
|
from sugar3.bundle.bundle import Bundle, NotInstalledException, \
|
||||||
MalformedBundleException
|
MalformedBundleException
|
||||||
|
|
||||||
from sugar.bundle.bundleversion import NormalizedVersion
|
from sugar3.bundle.bundleversion import NormalizedVersion
|
||||||
from sugar.bundle.bundleversion import InvalidVersionError
|
from sugar3.bundle.bundleversion import InvalidVersionError
|
||||||
|
|
||||||
|
|
||||||
class ContentBundle(Bundle):
|
class ContentBundle(Bundle):
|
||||||
|
@ -13,14 +13,14 @@ Examples
|
|||||||
create a simple alert message.
|
create a simple alert message.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
from sugar.graphics.alert import Alert
|
from sugar3.graphics.alert import Alert
|
||||||
...
|
...
|
||||||
# Create a new simple alert
|
# Create a new simple alert
|
||||||
alert = Alert()
|
alert = Alert()
|
||||||
# Populate the title and text body of the alert.
|
# Populate the title and text body of the alert.
|
||||||
alert.props.title=_('Title of Alert Goes Here')
|
alert.props.title=_('Title of Alert Goes Here')
|
||||||
alert.props.msg = _('Text message of alert goes here')
|
alert.props.msg = _('Text message of alert goes here')
|
||||||
# Call the add_alert() method (inherited via the sugar.graphics.Window
|
# Call the add_alert() method (inherited via the sugar3.graphics.Window
|
||||||
# superclass of Activity) to add this alert to the activity window.
|
# superclass of Activity) to add this alert to the activity window.
|
||||||
self.add_alert(alert)
|
self.add_alert(alert)
|
||||||
alert.show()
|
alert.show()
|
||||||
@ -52,8 +52,8 @@ import gobject
|
|||||||
import pango
|
import pango
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
|
|
||||||
|
|
||||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||||
@ -252,7 +252,7 @@ class ConfirmationAlert(Alert):
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
from sugar.graphics.alert import ConfirmationAlert
|
from sugar3.graphics.alert import ConfirmationAlert
|
||||||
...
|
...
|
||||||
#### Method: _alert_confirmation, create a Confirmation alert (with ok
|
#### Method: _alert_confirmation, create a Confirmation alert (with ok
|
||||||
and cancel buttons standard)
|
and cancel buttons standard)
|
||||||
@ -304,7 +304,7 @@ class ErrorAlert(Alert):
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
from sugar.graphics.alert import ErrorAlert
|
from sugar3.graphics.alert import ErrorAlert
|
||||||
...
|
...
|
||||||
#### Method: _alert_error, create a Error alert (with ok
|
#### Method: _alert_error, create a Error alert (with ok
|
||||||
button standard)
|
button standard)
|
||||||
@ -388,7 +388,7 @@ class TimeoutAlert(Alert):
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
from sugar.graphics.alert import TimeoutAlert
|
from sugar3.graphics.alert import TimeoutAlert
|
||||||
...
|
...
|
||||||
#### Method: _alert_timeout, create a Timeout alert (with ok and cancel
|
#### Method: _alert_timeout, create a Timeout alert (with ok and cancel
|
||||||
buttons standard)
|
buttons standard)
|
||||||
@ -452,7 +452,7 @@ class NotifyAlert(Alert):
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
from sugar.graphics.alert import NotifyAlert
|
from sugar3.graphics.alert import NotifyAlert
|
||||||
...
|
...
|
||||||
#### Method: _alert_notify, create a Notify alert (with only an 'OK'
|
#### Method: _alert_notify, create a Notify alert (with only an 'OK'
|
||||||
button)
|
button)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import gtk
|
import gtk
|
||||||
import hippo
|
import hippo
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
|
|
||||||
|
|
||||||
class CanvasTextView(hippo.CanvasWidget):
|
class CanvasTextView(hippo.CanvasWidget):
|
||||||
|
@ -22,9 +22,9 @@ import gobject
|
|||||||
import struct
|
import struct
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.palette import Palette, ToolInvoker, WidgetInvoker
|
from sugar3.graphics.palette import Palette, ToolInvoker, WidgetInvoker
|
||||||
|
|
||||||
|
|
||||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||||
@ -40,7 +40,7 @@ class _ColorButton(gtk.Button):
|
|||||||
but does not have any alpha support.
|
but does not have any alpha support.
|
||||||
Instead of a color selector dialog it will pop up a Sugar palette.
|
Instead of a color selector dialog it will pop up a Sugar palette.
|
||||||
|
|
||||||
As a preview an sugar.graphics.Icon is used. The fill color will be set to
|
As a preview an sugar3.graphics.Icon is used. The fill color will be set to
|
||||||
the current color, and the stroke color is set to the font color.
|
the current color, and the stroke color is set to the font color.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ class _ColorButton(gtk.Button):
|
|||||||
|
|
||||||
class _ColorPalette(Palette):
|
class _ColorPalette(Palette):
|
||||||
"""This is a color picker palette. It will usually be used indirectly
|
"""This is a color picker palette. It will usually be used indirectly
|
||||||
trough a sugar.graphics.ColorButton.
|
trough a sugar3.graphics.ColorButton.
|
||||||
"""
|
"""
|
||||||
_RED = 0
|
_RED = 0
|
||||||
_GREEN = 1
|
_GREEN = 1
|
||||||
|
@ -30,8 +30,8 @@ import gtk
|
|||||||
import hippo
|
import hippo
|
||||||
import cairo
|
import cairo
|
||||||
|
|
||||||
from sugar.graphics.xocolor import XoColor
|
from sugar3.graphics.xocolor import XoColor
|
||||||
from sugar.util import LRU
|
from sugar3.util import LRU
|
||||||
|
|
||||||
|
|
||||||
_BADGE_SIZE = 0.45
|
_BADGE_SIZE = 0.45
|
||||||
@ -325,7 +325,7 @@ class Icon(gtk.Image):
|
|||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self._buffer = _IconBuffer()
|
self._buffer = _IconBuffer()
|
||||||
# HACK: need to keep a reference to the path so it doesn't get garbage
|
# HACK: need to keep a reference to the path so it doesn't get garbage
|
||||||
# collected while it's still used if it's a sugar.util.TempFilePath.
|
# collected while it's still used if it's a sugar3.util.TempFilePath.
|
||||||
# See #1175
|
# See #1175
|
||||||
self._file = None
|
self._file = None
|
||||||
self._alpha = 1.0
|
self._alpha = 1.0
|
||||||
@ -558,7 +558,7 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
|
|||||||
__gtype_name__ = 'CanvasIcon'
|
__gtype_name__ = 'CanvasIcon'
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
from sugar.graphics.palette import CanvasInvoker
|
from sugar3.graphics.palette import CanvasInvoker
|
||||||
|
|
||||||
self._buffer = _IconBuffer()
|
self._buffer = _IconBuffer()
|
||||||
self._palette_invoker = CanvasInvoker()
|
self._palette_invoker = CanvasInvoker()
|
||||||
@ -980,7 +980,7 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
|
|||||||
type=object, setter=set_palette_invoker, getter=get_palette_invoker)
|
type=object, setter=set_palette_invoker, getter=get_palette_invoker)
|
||||||
|
|
||||||
def set_tooltip(self, text):
|
def set_tooltip(self, text):
|
||||||
from sugar.graphics.palette import Palette
|
from sugar3.graphics.palette import Palette
|
||||||
|
|
||||||
self.set_palette(Palette(text))
|
self.set_palette(Palette(text))
|
||||||
|
|
||||||
@ -994,7 +994,7 @@ class CellRendererIcon(gtk.GenericCellRenderer):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, tree_view):
|
def __init__(self, tree_view):
|
||||||
from sugar.graphics.palette import CellRendererInvoker
|
from sugar3.graphics.palette import CellRendererInvoker
|
||||||
|
|
||||||
self._buffer = _IconBuffer()
|
self._buffer = _IconBuffer()
|
||||||
self._buffer.cache = True
|
self._buffer.cache = True
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.icon import _SVGLoader
|
from sugar3.graphics.icon import _SVGLoader
|
||||||
|
|
||||||
ICON_ENTRY_PRIMARY = gtk.ENTRY_ICON_PRIMARY
|
ICON_ENTRY_PRIMARY = gtk.ENTRY_ICON_PRIMARY
|
||||||
ICON_ENTRY_SECONDARY = gtk.ENTRY_ICON_SECONDARY
|
ICON_ENTRY_SECONDARY = gtk.ENTRY_ICON_SECONDARY
|
||||||
|
@ -25,7 +25,7 @@ import gobject
|
|||||||
import pango
|
import pango
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
|
|
||||||
|
|
||||||
class MenuItem(gtk.ImageMenuItem):
|
class MenuItem(gtk.ImageMenuItem):
|
||||||
|
@ -25,7 +25,7 @@ import gobject
|
|||||||
import gtk
|
import gtk
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
from sugar.datastore import datastore
|
from sugar3.datastore import datastore
|
||||||
|
|
||||||
|
|
||||||
J_DBUS_SERVICE = 'org.laptop.Journal'
|
J_DBUS_SERVICE = 'org.laptop.Journal'
|
||||||
|
@ -25,16 +25,16 @@ import gtk
|
|||||||
import gobject
|
import gobject
|
||||||
import pango
|
import pango
|
||||||
|
|
||||||
from sugar.graphics import palettegroup
|
from sugar3.graphics import palettegroup
|
||||||
from sugar.graphics import animator
|
from sugar3.graphics import animator
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.palettewindow import PaletteWindow
|
from sugar3.graphics.palettewindow import PaletteWindow
|
||||||
from sugar import _sugarext
|
from sugar import _sugarext
|
||||||
|
|
||||||
# DEPRECATED
|
# DEPRECATED
|
||||||
# Import these for backwards compatibility
|
# Import these for backwards compatibility
|
||||||
from sugar.graphics.palettewindow import MouseSpeedDetector, Invoker, \
|
from sugar3.graphics.palettewindow import MouseSpeedDetector, Invoker, \
|
||||||
WidgetInvoker, CanvasInvoker, ToolInvoker, CellRendererInvoker
|
WidgetInvoker, CanvasInvoker, ToolInvoker, CellRendererInvoker
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,9 +27,9 @@ import gtk
|
|||||||
import gobject
|
import gobject
|
||||||
import hippo
|
import hippo
|
||||||
|
|
||||||
from sugar.graphics import palettegroup
|
from sugar3.graphics import palettegroup
|
||||||
from sugar.graphics import animator
|
from sugar3.graphics import animator
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
|
|
||||||
|
|
||||||
def _calculate_gap(a, b):
|
def _calculate_gap(a, b):
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
from sugar.graphics.palette import Palette
|
from sugar3.graphics.palette import Palette
|
||||||
|
|
||||||
|
|
||||||
class RadioMenuButton(ToolButton):
|
class RadioMenuButton(ToolButton):
|
||||||
|
@ -23,9 +23,9 @@ STABLE.
|
|||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.palette import Palette, ToolInvoker
|
from sugar3.graphics.palette import Palette, ToolInvoker
|
||||||
from sugar.graphics import toolbutton
|
from sugar3.graphics import toolbutton
|
||||||
|
|
||||||
|
|
||||||
class RadioToolButton(gtk.RadioToolButton):
|
class RadioToolButton(gtk.RadioToolButton):
|
||||||
|
@ -23,7 +23,7 @@ import math
|
|||||||
|
|
||||||
import hippo
|
import hippo
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
|
|
||||||
|
|
||||||
class CanvasRoundBox(hippo.CanvasBox, hippo.CanvasItem):
|
class CanvasRoundBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||||
|
@ -22,8 +22,8 @@ STABLE.
|
|||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.palette import Palette, ToolInvoker
|
from sugar3.graphics.palette import Palette, ToolInvoker
|
||||||
|
|
||||||
|
|
||||||
class ToggleToolButton(gtk.ToggleToolButton):
|
class ToggleToolButton(gtk.ToggleToolButton):
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.palette import PaletteWindow, ToolInvoker
|
from sugar3.graphics.palette import PaletteWindow, ToolInvoker
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
from sugar.graphics import palettegroup
|
from sugar3.graphics import palettegroup
|
||||||
|
|
||||||
|
|
||||||
class ToolbarButton(ToolButton):
|
class ToolbarButton(ToolButton):
|
||||||
|
@ -22,7 +22,7 @@ STABLE.
|
|||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
|
|
||||||
|
|
||||||
class Toolbox(gtk.VBox):
|
class Toolbox(gtk.VBox):
|
||||||
|
@ -25,8 +25,8 @@ import logging
|
|||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.palette import Palette, ToolInvoker
|
from sugar3.graphics.palette import Palette, ToolInvoker
|
||||||
|
|
||||||
|
|
||||||
def _add_accelerator(tool_button):
|
def _add_accelerator(tool_button):
|
||||||
|
@ -22,8 +22,8 @@ STABLE.
|
|||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar.graphics.combobox import ComboBox
|
from sugar3.graphics.combobox import ComboBox
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
|
|
||||||
|
|
||||||
class ToolComboBox(gtk.ToolItem):
|
class ToolComboBox(gtk.ToolItem):
|
||||||
|
@ -22,10 +22,10 @@ STABLE.
|
|||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar3.graphics import style
|
||||||
from sugar.graphics.palette import ToolInvoker
|
from sugar3.graphics.palette import ToolInvoker
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
|
|
||||||
|
|
||||||
_PREVIOUS_PAGE = 0
|
_PREVIOUS_PAGE = 0
|
||||||
|
@ -24,8 +24,8 @@ import gobject
|
|||||||
import gtk
|
import gtk
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics import palettegroup
|
from sugar3.graphics import palettegroup
|
||||||
|
|
||||||
|
|
||||||
_UNFULLSCREEN_BUTTON_VISIBILITY_TIMEOUT = 2
|
_UNFULLSCREEN_BUTTON_VISIBILITY_TIMEOUT = 2
|
||||||
|
@ -39,12 +39,12 @@ from telepathy.constants import CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES, \
|
|||||||
HANDLE_TYPE_CONTACT, \
|
HANDLE_TYPE_CONTACT, \
|
||||||
PROPERTY_FLAG_WRITE
|
PROPERTY_FLAG_WRITE
|
||||||
|
|
||||||
from sugar.presence.buddy import Buddy
|
from sugar3.presence.buddy import Buddy
|
||||||
|
|
||||||
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
|
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
|
||||||
CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
|
CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
|
||||||
|
|
||||||
_logger = logging.getLogger('sugar.presence.activity')
|
_logger = logging.getLogger('sugar3.presence.activity')
|
||||||
|
|
||||||
|
|
||||||
class Activity(gobject.GObject):
|
class Activity(gobject.GObject):
|
||||||
|
@ -31,12 +31,12 @@ from telepathy.interfaces import CONNECTION, \
|
|||||||
CONNECTION_INTERFACE_CONTACTS
|
CONNECTION_INTERFACE_CONTACTS
|
||||||
from telepathy.constants import HANDLE_TYPE_CONTACT
|
from telepathy.constants import HANDLE_TYPE_CONTACT
|
||||||
|
|
||||||
from sugar.presence.connectionmanager import get_connection_manager
|
from sugar3.presence.connectionmanager import get_connection_manager
|
||||||
|
|
||||||
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
||||||
CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
|
CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
|
||||||
|
|
||||||
_logger = logging.getLogger('sugar.presence.buddy')
|
_logger = logging.getLogger('sugar3.presence.buddy')
|
||||||
|
|
||||||
|
|
||||||
class BaseBuddy(gobject.GObject):
|
class BaseBuddy(gobject.GObject):
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# Boston, MA 02111-1307, USA.
|
# Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
UNSTABLE. It should really be internal to the sugar.presence package.
|
UNSTABLE. It should really be internal to the sugar3.presence package.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
@ -28,9 +28,9 @@ import dbus.exceptions
|
|||||||
import dbus.glib
|
import dbus.glib
|
||||||
from dbus import PROPERTIES_IFACE
|
from dbus import PROPERTIES_IFACE
|
||||||
|
|
||||||
from sugar.presence.buddy import Buddy, Owner
|
from sugar3.presence.buddy import Buddy, Owner
|
||||||
from sugar.presence.activity import Activity
|
from sugar3.presence.activity import Activity
|
||||||
from sugar.presence.connectionmanager import get_connection_manager
|
from sugar3.presence.connectionmanager import get_connection_manager
|
||||||
|
|
||||||
from telepathy.interfaces import ACCOUNT, \
|
from telepathy.interfaces import ACCOUNT, \
|
||||||
ACCOUNT_MANAGER, \
|
ACCOUNT_MANAGER, \
|
||||||
@ -38,7 +38,7 @@ from telepathy.interfaces import ACCOUNT, \
|
|||||||
from telepathy.constants import HANDLE_TYPE_CONTACT
|
from telepathy.constants import HANDLE_TYPE_CONTACT
|
||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger('sugar.presence.presenceservice')
|
_logger = logging.getLogger('sugar3.presence.presenceservice')
|
||||||
|
|
||||||
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
||||||
ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'
|
ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'
|
||||||
|
@ -22,8 +22,8 @@ STABLE.
|
|||||||
from telepathy.constants import (
|
from telepathy.constants import (
|
||||||
CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES)
|
CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES)
|
||||||
|
|
||||||
from sugar.presence.tubeconn import TubeConnection
|
from sugar3.presence.tubeconn import TubeConnection
|
||||||
from sugar.presence import presenceservice
|
from sugar3.presence import presenceservice
|
||||||
|
|
||||||
|
|
||||||
class SugarTubeConnection(TubeConnection):
|
class SugarTubeConnection(TubeConnection):
|
||||||
@ -42,7 +42,7 @@ class SugarTubeConnection(TubeConnection):
|
|||||||
"""Retrieve a Buddy object given a telepathy handle.
|
"""Retrieve a Buddy object given a telepathy handle.
|
||||||
|
|
||||||
cs_handle: A channel-specific CONTACT type handle.
|
cs_handle: A channel-specific CONTACT type handle.
|
||||||
returns: sugar.presence Buddy object or None
|
returns: sugar3.presence Buddy object or None
|
||||||
"""
|
"""
|
||||||
pservice = presenceservice.get_instance()
|
pservice = presenceservice.get_instance()
|
||||||
if self.self_handle == cs_handle:
|
if self.self_handle == cs_handle:
|
||||||
|
@ -27,7 +27,7 @@ from ConfigParser import ConfigParser
|
|||||||
|
|
||||||
from sugar import env
|
from sugar import env
|
||||||
from sugar import util
|
from sugar import util
|
||||||
from sugar.graphics.xocolor import XoColor
|
from sugar3.graphics.xocolor import XoColor
|
||||||
|
|
||||||
|
|
||||||
_profile = None
|
_profile = None
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
|
|
||||||
|
|
||||||
class Test(gtk.VBox):
|
class Test(gtk.VBox):
|
||||||
|
@ -2,8 +2,8 @@ import hippo
|
|||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar.graphics.icon import CanvasIcon
|
from sugar3.graphics.icon import CanvasIcon
|
||||||
from sugar.graphics.roundbox import CanvasRoundBox
|
from sugar3.graphics.roundbox import CanvasRoundBox
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
# Boston, MA 02111-1307, USA.
|
# Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Test the sugar.graphics.icon.* cache.
|
Test the sugar3.graphics.icon.* cache.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.xocolor import XoColor
|
from sugar3.graphics.xocolor import XoColor
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
# Boston, MA 02111-1307, USA.
|
# Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Test the sugar.graphics.icon.Icon widget.
|
Test the sugar3.graphics.icon.Icon widget.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
from sugar.graphics.xocolor import XoColor
|
from sugar3.graphics.xocolor import XoColor
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
@ -23,8 +23,8 @@ controls. Ticket #2855.
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.palette import Palette
|
from sugar3.graphics.palette import Palette
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ Spec in ticket #2999.
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.palette import Palette
|
from sugar3.graphics.palette import Palette
|
||||||
from sugar.graphics.icon import Icon
|
from sugar3.graphics.icon import Icon
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ Spec in ticket #3000.
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ Test palette positioning for toolbar and tray.
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.tray import HTray, TrayButton
|
from sugar3.graphics.tray import HTray, TrayButton
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar3.graphics.toolbutton import ToolButton
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
# Boston, MA 02111-1307, USA.
|
# Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Test the sugar.graphics.icon.Icon widget.
|
Test the sugar3.graphics.icon.Icon widget.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar.graphics.tray import HTray, VTray
|
from sugar3.graphics.tray import HTray, VTray
|
||||||
from sugar.graphics.tray import TrayButton, TrayIcon
|
from sugar3.graphics.tray import TrayButton, TrayIcon
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user