~ubuntu-branches/ubuntu/wily/system-config-printer/wily

« back to all changes in this revision

Viewing changes to statereason.py

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2014-08-05 23:59:59 UTC
  • mfrom: (256.1.1 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20140805235959-v1yzis5mo1nkxo2m
Tags: 1.5.0+20140805-0ubuntu2
debian/control: Build-depend on Python 3 (python3-all-dev).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
 
1
#!/usr/bin/python3
2
2
 
3
3
## Copyright (C) 2007, 2008, 2009, 2010, 2012, 2013 Red Hat, Inc.
4
4
## Authors:
23
23
import os
24
24
import config
25
25
import gettext
26
 
gettext.install(domain=config.PACKAGE, localedir=config.localedir, unicode=True)
 
26
gettext.install(domain=config.PACKAGE, localedir=config.localedir)
27
27
 
28
28
class StateReason:
29
29
    REPORT=1
156
156
    def get_tuple (self):
157
157
        return (self.get_level (), self.get_printer (), self.get_reason ())
158
158
 
159
 
    def __cmp__(self, other):
 
159
    def __lt__(self, other):
160
160
        if other == None:
161
161
            return 1
162
162
        if other.get_level () != self.get_level ():
163
 
            return cmp (self.get_level (), other.get_level ())
 
163
            return lt (self.get_level (), other.get_level ())
164
164
        if other.get_printer () != self.get_printer ():
165
 
            return cmp (other.get_printer (), self.get_printer ())
166
 
        return cmp (other.get_reason (), self.get_reason ())
 
165
            return lt (other.get_printer (), self.get_printer ())
 
166
        return lt (other.get_reason (), self.get_reason ())