~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to lib/common/caps.py

  • Committer: mattgiuca
  • Date: 2008-02-16 03:39:25 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:482
common/caps.py: The 'cmp' of a Role now gives between -1 and 1, not
    the integer difference (this is how 'cmp' is supposed to work;
    it now internally uses the cmp function).
    At the suggestion of Steven Bird.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    def __repr__(self):
66
66
        return "Role.%s" % Role._roles[self._role].upper()
67
67
    def __cmp__(self, other):
68
 
        return self._role - other._role
 
68
        return cmp(self._role, other._role)
69
69
    def __hash__(self):
70
70
        return hash(self._role)
71
71