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:
@@ -13,14 +13,14 @@ Examples
|
||||
create a simple alert message.
|
||||
|
||||
.. code-block:: python
|
||||
from sugar.graphics.alert import Alert
|
||||
from sugar3.graphics.alert import Alert
|
||||
...
|
||||
# Create a new simple alert
|
||||
alert = Alert()
|
||||
# Populate the title and text body of the alert.
|
||||
alert.props.title=_('Title 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.
|
||||
self.add_alert(alert)
|
||||
alert.show()
|
||||
@@ -52,8 +52,8 @@ import gobject
|
||||
import pango
|
||||
import math
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.icon import Icon
|
||||
|
||||
|
||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||
@@ -252,7 +252,7 @@ class ConfirmationAlert(Alert):
|
||||
--------
|
||||
|
||||
.. code-block:: python
|
||||
from sugar.graphics.alert import ConfirmationAlert
|
||||
from sugar3.graphics.alert import ConfirmationAlert
|
||||
...
|
||||
#### Method: _alert_confirmation, create a Confirmation alert (with ok
|
||||
and cancel buttons standard)
|
||||
@@ -304,7 +304,7 @@ class ErrorAlert(Alert):
|
||||
--------
|
||||
|
||||
.. code-block:: python
|
||||
from sugar.graphics.alert import ErrorAlert
|
||||
from sugar3.graphics.alert import ErrorAlert
|
||||
...
|
||||
#### Method: _alert_error, create a Error alert (with ok
|
||||
button standard)
|
||||
@@ -388,7 +388,7 @@ class TimeoutAlert(Alert):
|
||||
--------
|
||||
|
||||
.. 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
|
||||
buttons standard)
|
||||
@@ -452,7 +452,7 @@ class NotifyAlert(Alert):
|
||||
--------
|
||||
|
||||
.. 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'
|
||||
button)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import gtk
|
||||
import hippo
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar3.graphics import style
|
||||
|
||||
|
||||
class CanvasTextView(hippo.CanvasWidget):
|
||||
|
||||
@@ -22,9 +22,9 @@ import gobject
|
||||
import struct
|
||||
import logging
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.graphics.palette import Palette, ToolInvoker, WidgetInvoker
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.graphics.palette import Palette, ToolInvoker, WidgetInvoker
|
||||
|
||||
|
||||
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||
@@ -40,7 +40,7 @@ class _ColorButton(gtk.Button):
|
||||
but does not have any alpha support.
|
||||
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.
|
||||
"""
|
||||
|
||||
@@ -232,7 +232,7 @@ class _ColorButton(gtk.Button):
|
||||
|
||||
class _ColorPalette(Palette):
|
||||
"""This is a color picker palette. It will usually be used indirectly
|
||||
trough a sugar.graphics.ColorButton.
|
||||
trough a sugar3.graphics.ColorButton.
|
||||
"""
|
||||
_RED = 0
|
||||
_GREEN = 1
|
||||
|
||||
@@ -30,8 +30,8 @@ import gtk
|
||||
import hippo
|
||||
import cairo
|
||||
|
||||
from sugar.graphics.xocolor import XoColor
|
||||
from sugar.util import LRU
|
||||
from sugar3.graphics.xocolor import XoColor
|
||||
from sugar3.util import LRU
|
||||
|
||||
|
||||
_BADGE_SIZE = 0.45
|
||||
@@ -325,7 +325,7 @@ class Icon(gtk.Image):
|
||||
def __init__(self, **kwargs):
|
||||
self._buffer = _IconBuffer()
|
||||
# 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
|
||||
self._file = None
|
||||
self._alpha = 1.0
|
||||
@@ -558,7 +558,7 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
|
||||
__gtype_name__ = 'CanvasIcon'
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
from sugar.graphics.palette import CanvasInvoker
|
||||
from sugar3.graphics.palette import CanvasInvoker
|
||||
|
||||
self._buffer = _IconBuffer()
|
||||
self._palette_invoker = CanvasInvoker()
|
||||
@@ -980,7 +980,7 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
|
||||
type=object, setter=set_palette_invoker, getter=get_palette_invoker)
|
||||
|
||||
def set_tooltip(self, text):
|
||||
from sugar.graphics.palette import Palette
|
||||
from sugar3.graphics.palette import Palette
|
||||
|
||||
self.set_palette(Palette(text))
|
||||
|
||||
@@ -994,7 +994,7 @@ class CellRendererIcon(gtk.GenericCellRenderer):
|
||||
}
|
||||
|
||||
def __init__(self, tree_view):
|
||||
from sugar.graphics.palette import CellRendererInvoker
|
||||
from sugar3.graphics.palette import CellRendererInvoker
|
||||
|
||||
self._buffer = _IconBuffer()
|
||||
self._buffer.cache = True
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
import gtk
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.icon import _SVGLoader
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.icon import _SVGLoader
|
||||
|
||||
ICON_ENTRY_PRIMARY = gtk.ENTRY_ICON_PRIMARY
|
||||
ICON_ENTRY_SECONDARY = gtk.ENTRY_ICON_SECONDARY
|
||||
|
||||
@@ -25,7 +25,7 @@ import gobject
|
||||
import pango
|
||||
import gtk
|
||||
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar3.graphics.icon import Icon
|
||||
|
||||
|
||||
class MenuItem(gtk.ImageMenuItem):
|
||||
|
||||
@@ -25,7 +25,7 @@ import gobject
|
||||
import gtk
|
||||
import dbus
|
||||
|
||||
from sugar.datastore import datastore
|
||||
from sugar3.datastore import datastore
|
||||
|
||||
|
||||
J_DBUS_SERVICE = 'org.laptop.Journal'
|
||||
|
||||
@@ -25,16 +25,16 @@ import gtk
|
||||
import gobject
|
||||
import pango
|
||||
|
||||
from sugar.graphics import palettegroup
|
||||
from sugar.graphics import animator
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.graphics.palettewindow import PaletteWindow
|
||||
from sugar3.graphics import palettegroup
|
||||
from sugar3.graphics import animator
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.graphics.palettewindow import PaletteWindow
|
||||
from sugar import _sugarext
|
||||
|
||||
# DEPRECATED
|
||||
# Import these for backwards compatibility
|
||||
from sugar.graphics.palettewindow import MouseSpeedDetector, Invoker, \
|
||||
from sugar3.graphics.palettewindow import MouseSpeedDetector, Invoker, \
|
||||
WidgetInvoker, CanvasInvoker, ToolInvoker, CellRendererInvoker
|
||||
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ import gtk
|
||||
import gobject
|
||||
import hippo
|
||||
|
||||
from sugar.graphics import palettegroup
|
||||
from sugar.graphics import animator
|
||||
from sugar.graphics import style
|
||||
from sugar3.graphics import palettegroup
|
||||
from sugar3.graphics import animator
|
||||
from sugar3.graphics import style
|
||||
|
||||
|
||||
def _calculate_gap(a, b):
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
import gtk
|
||||
|
||||
from sugar.graphics.toolbutton import ToolButton
|
||||
from sugar.graphics.palette import Palette
|
||||
from sugar3.graphics.toolbutton import ToolButton
|
||||
from sugar3.graphics.palette import Palette
|
||||
|
||||
|
||||
class RadioMenuButton(ToolButton):
|
||||
|
||||
@@ -23,9 +23,9 @@ STABLE.
|
||||
import gtk
|
||||
import gobject
|
||||
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.graphics.palette import Palette, ToolInvoker
|
||||
from sugar.graphics import toolbutton
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.graphics.palette import Palette, ToolInvoker
|
||||
from sugar3.graphics import toolbutton
|
||||
|
||||
|
||||
class RadioToolButton(gtk.RadioToolButton):
|
||||
|
||||
@@ -23,7 +23,7 @@ import math
|
||||
|
||||
import hippo
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar3.graphics import style
|
||||
|
||||
|
||||
class CanvasRoundBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
|
||||
@@ -22,8 +22,8 @@ STABLE.
|
||||
import gobject
|
||||
import gtk
|
||||
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.graphics.palette import Palette, ToolInvoker
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.graphics.palette import Palette, ToolInvoker
|
||||
|
||||
|
||||
class ToggleToolButton(gtk.ToggleToolButton):
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
import gtk
|
||||
import gobject
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.palette import PaletteWindow, ToolInvoker
|
||||
from sugar.graphics.toolbutton import ToolButton
|
||||
from sugar.graphics import palettegroup
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.palette import PaletteWindow, ToolInvoker
|
||||
from sugar3.graphics.toolbutton import ToolButton
|
||||
from sugar3.graphics import palettegroup
|
||||
|
||||
|
||||
class ToolbarButton(ToolButton):
|
||||
|
||||
@@ -22,7 +22,7 @@ STABLE.
|
||||
import gtk
|
||||
import gobject
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar3.graphics import style
|
||||
|
||||
|
||||
class Toolbox(gtk.VBox):
|
||||
|
||||
@@ -25,8 +25,8 @@ import logging
|
||||
import gtk
|
||||
import gobject
|
||||
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.graphics.palette import Palette, ToolInvoker
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.graphics.palette import Palette, ToolInvoker
|
||||
|
||||
|
||||
def _add_accelerator(tool_button):
|
||||
|
||||
@@ -22,8 +22,8 @@ STABLE.
|
||||
import gtk
|
||||
import gobject
|
||||
|
||||
from sugar.graphics.combobox import ComboBox
|
||||
from sugar.graphics import style
|
||||
from sugar3.graphics.combobox import ComboBox
|
||||
from sugar3.graphics import style
|
||||
|
||||
|
||||
class ToolComboBox(gtk.ToolItem):
|
||||
|
||||
@@ -22,10 +22,10 @@ STABLE.
|
||||
import gobject
|
||||
import gtk
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.graphics.palette import ToolInvoker
|
||||
from sugar.graphics.toolbutton import ToolButton
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.palette import ToolInvoker
|
||||
from sugar3.graphics.toolbutton import ToolButton
|
||||
from sugar3.graphics.icon import Icon
|
||||
|
||||
|
||||
_PREVIOUS_PAGE = 0
|
||||
|
||||
@@ -24,8 +24,8 @@ import gobject
|
||||
import gtk
|
||||
import warnings
|
||||
|
||||
from sugar.graphics.icon import Icon
|
||||
from sugar.graphics import palettegroup
|
||||
from sugar3.graphics.icon import Icon
|
||||
from sugar3.graphics import palettegroup
|
||||
|
||||
|
||||
_UNFULLSCREEN_BUTTON_VISIBILITY_TIMEOUT = 2
|
||||
|
||||
Reference in New Issue
Block a user