[Rigo] move LocalActivityStates to rigo.enums

This commit is contained in:
Fabio Erculiani
2012-03-17 17:11:31 +01:00
parent 3e94e1cf52
commit 4da1bd7a5c
2 changed files with 37 additions and 32 deletions
+35 -7
View File
@@ -57,13 +57,41 @@ class TransactionTypes:
REPAIR = "repair_dependencies"
from .version import VERSION, DISTRO, RELEASE, CODENAME
USER_AGENT="Entropy Rigo/%s (N;) %s/%s (%s)" % (VERSION,
DISTRO,
RELEASE,
CODENAME)
USER_AGENT="Entropy Rigo/%s (N;) %s/%s (%s)" % (
VERSION,
DISTRO,
RELEASE,
CODENAME)
class RigoViewStates:
# Possible Rigo Application UI States
BROWSER_VIEW_STATE, STATIC_VIEW_STATE, \
APPLICATION_VIEW_STATE, \
WORK_VIEW_STATE = range(4)
(
BROWSER_VIEW_STATE,
STATIC_VIEW_STATE,
APPLICATION_VIEW_STATE,
WORK_VIEW_STATE,
) = range(4)
class LocalActivityStates:
(
READY,
UPDATING_REPOSITORIES_MASTER,
UPDATING_REPOSITORIES_SLAVE,
INSTALLING_APPLICATIONS,
) = range(4)
class BusyError(Exception):
"""
Cannot acknowledge a Local Activity change.
"""
class AlreadyReadyError(Exception):
"""
Cannot acknowledge a Local Activity change to
"READY" state, because we're already ready.
"""
class UnbusyFromDifferentActivity(Exception):
"""
Unbusy request from different activity.
"""
+2 -25
View File
@@ -40,7 +40,8 @@ from gi.repository import Gtk, Gdk, Gio, GLib, GObject, Vte, Pango, \
Polkit
from rigo.paths import DATA_DIR
from rigo.enums import Icons, AppActions, RigoViewStates
from rigo.enums import Icons, AppActions, RigoViewStates, \
LocalActivityStates
from rigo.entropyapi import EntropyWebService
from rigo.models.application import Application, ApplicationMetadata
from rigo.ui.gtk3.widgets.apptreeview import AppTreeView
@@ -125,30 +126,6 @@ class RigoAuthenticationController(object):
self._mainloop)
class LocalActivityStates:
(
READY,
UPDATING_REPOSITORIES_MASTER,
UPDATING_REPOSITORIES_SLAVE,
INSTALLING_APPLICATIONS,
) = range(4)
class BusyError(Exception):
"""
Cannot acknowledge a Local Activity change.
"""
class AlreadyReadyError(Exception):
"""
Cannot acknowledge a Local Activity change to
"READY" state, because we're already ready.
"""
class UnbusyFromDifferentActivity(Exception):
"""
Unbusy request from different activity.
"""
class RigoServiceController(GObject.Object):
"""