From 4da1bd7a5ced78fcef9f2f15f4d8a05fb9cc1831 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 17 Mar 2012 17:11:31 +0100 Subject: [PATCH] [Rigo] move LocalActivityStates to rigo.enums --- rigo/rigo/enums.py | 42 +++++++++++++++++++++++++++++++++++------- rigo/rigo_app.py | 27 ++------------------------- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/rigo/rigo/enums.py b/rigo/rigo/enums.py index 178ed0694..21e334605 100644 --- a/rigo/rigo/enums.py +++ b/rigo/rigo/enums.py @@ -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. + """ diff --git a/rigo/rigo_app.py b/rigo/rigo_app.py index 58f40787f..90d057a08 100644 --- a/rigo/rigo_app.py +++ b/rigo/rigo_app.py @@ -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): """