~mmcg069/software-center/enum-style-idea

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk/appview.py

  • Committer: Matthew McGowan
  • Date: 2011-06-05 22:50:04 UTC
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110605225004-sp9z0c698qguud02
change enum style

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import pango
29
29
import xapian
30
30
 
31
 
from softwarecenter.enums import (APP_ACTION_REMOVE,
32
 
                                  APP_ACTION_INSTALL,
33
 
                                  XAPIAN_VALUE_ARCHIVE_CHANNEL,
 
31
from softwarecenter.enums import (AppActions, XapianValues,
34
32
                                  AVAILABLE_FOR_PURCHASE_MAGIC_CHANNEL_NAME,
35
33
                                  MOUSE_EVENT_BACK_BUTTON,
36
34
                                  MOUSE_EVENT_FORWARD_BUTTON,
1024
1022
                return False
1025
1023
            self._action_block_list.append(pkgname)
1026
1024
            if installed:
1027
 
                perform_action = APP_ACTION_REMOVE
 
1025
                perform_action = AppActions.REMOVE
1028
1026
            else:
1029
 
                perform_action = APP_ACTION_INSTALL
 
1027
                perform_action = AppActions.INSTALL
1030
1028
            self.emit("application-request-action", Application(appname, pkgname, request), [], [], perform_action)
1031
1029
        return False
1032
1030
 
1146
1144
            # an item is considered available if it is either found
1147
1145
            # in the cache or is available for purchase
1148
1146
            if (not pkgname in self.cache and 
1149
 
                not doc.get_value(XAPIAN_VALUE_ARCHIVE_CHANNEL) == AVAILABLE_FOR_PURCHASE_MAGIC_CHANNEL_NAME):
 
1147
                not doc.get_value(XapianValues.ARCHIVE_CHANNEL) == AVAILABLE_FOR_PURCHASE_MAGIC_CHANNEL_NAME):
1150
1148
                return False
1151
1149
        if self.installed_only:
1152
1150
            # use the lowlevel cache here, twice as fast