home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import cups
- from timedops import TimedOperation
- from base import *
-
- class NetworkCUPSPrinterShared(Question):
-
- def __init__(self, troubleshooter):
- Question.__init__(self, troubleshooter, 'Queue not shared?')
- page = self.initial_vbox(_('Queue Not Shared'), _('The CUPS printer on the server is not shared.'))
- troubleshooter.new_page(page, self)
-
-
- def display(self):
- self.answers = { }
- answers = self.troubleshooter.answers
- if answers.has_key('remote_cups_queue_listed') and answers['remote_cups_queue_listed'] == False:
- return False
- parent = self.troubleshooter.get_window()
- if not answers.has_key('remote_cups_queue_attributes'):
- if not answers.has_key('remote_server_try_connect') and answers.has_key('remote_cups_queue'):
- return False
-
- try:
- cups.setServer(answers['remote_server_try_connect'])
- self.op = TimedOperation(cups.Connection, parent = parent)
- c = self.op.run()
- self.op = TimedOperation(c.getPrinterAttributes, args = (answers['remote_cups_queue'],), parent = parent)
- attr = self.op.run()
- except RuntimeError:
- answers.has_key('remote_cups_queue')
- answers.has_key('remote_cups_queue')
- answers['remote_cups_queue_listed'] == False
- return False
- except cups.IPPError:
- return False
- else:
- self.answers['remote_cups_queue_attributes'] = attr
- except:
- None<EXCEPTION MATCH>cups.IPPError
- attr = answers['remote_cups_queue_attributes']
- if attr.has_key('printer-is-shared'):
- if not attr['printer-is-shared']:
- return True
-
-
- return False
-
-
- def can_click_forward(self):
- return False
-
-
- def collect_answer(self):
- return self.answers
-
-
- def cancel_operation(self):
- self.op.cancel()
-
-
-