~ubuntu-branches/debian/squeeze/aptdaemon/squeeze

« back to all changes in this revision

Viewing changes to aptdaemon/enums.py

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2010-02-02 16:14:55 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20100202161455-flf30cqux2a6s29n
Tags: 0.11+bzr322-1
* New upstream snapshot.
* Merge debian/patches/series from Ubuntu:
  - add 01_unused_removal.patch to allow removal of no longer
    used dependencies on removal
* debian/control: add break on software-center (from Ubuntu)
* Update Standards-Version to 3.8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 ERROR_PACKAGE_UNAUTHENTICATED,
48
48
 ERROR_UNKNOWN) = range(17)
49
49
 
50
 
# Message enums
51
 
(MSG_SYSTEM_ALREADY_UPTODATE,
52
 
 MSG_SYSTEM_NOT_UPTODATE) = range(2)
53
 
 
54
50
# Status codes
55
51
(STATUS_SETTING_UP,
56
52
 STATUS_WAITING,
81
77
    STATUS_CANCELLING:'aptdaemon-cleanup',
82
78
    STATUS_CLEANING_UP:'aptdaemon-cleanup',
83
79
    STATUS_RESOLVING_DEP:'aptdaemon-resolve',
84
 
    STATUS_COMMITTING:'aptdaemon-setup',
 
80
    STATUS_COMMITTING:'aptdaemon-working',
85
81
    STATUS_DOWNLOADING:'aptdaemon-download',
86
82
    STATUS_FINISHED:'aptdaemon-cleanup',
87
83
    STATUS_LOADING_CACHE:'aptdaemon-update-cache',
88
 
    STATUS_RUNNING:'aptdaemon-setup',
89
 
    STATUS_SETTING_UP:'aptdaemon-setup',
 
84
    STATUS_RUNNING:'aptdaemon-working',
 
85
    STATUS_SETTING_UP:'aptdaemon-working',
90
86
    STATUS_WAITING:'aptdaemon-wait',
91
87
    STATUS_WAITING_LOCK:'aptdaemon-wait',
92
88
    STATUS_WAITING_MEDIUM:'aptdaemon-wait',
97
93
   if ICONS_STATUS.has_key(enum):
98
94
       return ICONS_STATUS[enum]
99
95
   else:
100
 
       return None
 
96
       return "aptdaemon-working"
101
97
 
102
98
ICONS_ROLE = {
103
99
    ROLE_INSTALL_FILE:'aptdaemon-add',
112
108
   if ICONS_ROLE.has_key(enum):
113
109
       return ICONS_ROLE[enum]
114
110
   else:
115
 
       return None
 
111
       return "aptdaemon-working"
116
112
 
117
113
ANIMATIONS_STATUS = {
118
114
    STATUS_CANCELLING:'aptdaemon-action-cleaning-up',
183
179
   else:
184
180
       return None
185
181
 
 
182
ERROR_ROLE = {
 
183
    ROLE_INSTALL_FILE: _("Installation of the package file failed"),
 
184
    ROLE_INSTALL_PACKAGES: _("Installation of software failed"),
 
185
    ROLE_ADD_VENDOR_KEY_FILE: _("Adding the key to the list of trused "
 
186
                                "software vendors failed"),
 
187
    ROLE_UPDATE_CACHE: _("Refreshing the software list failed"),
 
188
    ROLE_REMOVE_VENDOR_KEY: _("Removing the vendor from the list of trusted "
 
189
                              "ones failed"),
 
190
    ROLE_REMOVE_PACKAGES: _("Removing software failed"),
 
191
    ROLE_UPGRADE_PACKAGES: _("Updating software failed"),
 
192
    ROLE_UPGRADE_SYSTEM: _("Upgrading the system failed"),
 
193
    ROLE_COMMIT_PACKAGES: _("Applying software changes failed"),
 
194
    ROLE_UNSET: ""
 
195
    }
 
196
 
 
197
def get_role_error_from_enum(enum):
 
198
   if ERROR_ROLE.has_key(enum):
 
199
       return ERROR_ROLE[enum]
 
200
   else:
 
201
       return None
 
202
 
186
203
DESCS_ERROR = {
187
204
    ERROR_PACKAGE_DOWNLOAD_FAILED : _("Check your Internet connection."),
188
205
    ERROR_REPO_DOWNLOAD_FAILED : _("Check your Internet connection."),
261
278
   else:
262
279
       return None
263
280
 
264
 
STRINGS_MESSAGE = {
265
 
    MSG_SYSTEM_ALREADY_UPTODATE : _("System is already up-to-date"),
266
 
    MSG_SYSTEM_NOT_UPTODATE : _("System is not up-to-date")
267
 
    }
268
 
 
269
 
def get_msg_string_from_enum(enum):
270
 
   if STRINGS_MESSAGE.has_key(enum):
271
 
       return STRINGS_MESSAGE[enum]
272
 
   else:
273
 
       return None
274
 
 
275
 
DESCS_MESSAGE = {
276
 
    MSG_SYSTEM_ALREADY_UPTODATE : _("There isn't any need for a system update"),
277
 
    MSG_SYSTEM_NOT_UPTODATE : _("It was not possible to install the latest "
278
 
                                "for all packages.")
279
 
    }
280
 
 
281
 
def get_msg_description_from_enum(enum):
282
 
   if DESCS_MESSAGE.has_key(enum):
283
 
       return DESCS_MESSAGE[enum]
284
 
   else:
285
 
       return None
286
 
 
287
281
STRINGS_STATUS = {
288
282
    STATUS_SETTING_UP : _("Waiting for service to start"),
289
283
    STATUS_WAITING : _("Waiting for other tasks"),