Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Public Attributes
troubleshoot.NetworkCUPSPrinterShared.NetworkCUPSPrinterShared Class Reference
Inheritance diagram for troubleshoot.NetworkCUPSPrinterShared.NetworkCUPSPrinterShared:
Inheritance graph
[legend]
Collaboration diagram for troubleshoot.NetworkCUPSPrinterShared.NetworkCUPSPrinterShared:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def display
def can_click_forward
def collect_answer
def cancel_operation
def connect_signals
def disconnect_signals
def initial_vbox
 Helper functions.

Public Attributes

 answers
 op
 troubleshooter

Detailed Description

Definition at line 25 of file NetworkCUPSPrinterShared.py.


Constructor & Destructor Documentation

Definition at line 26 of file NetworkCUPSPrinterShared.py.

00026 
00027     def __init__ (self, troubleshooter):
00028         Question.__init__ (self, troubleshooter, "Queue not shared?")
00029         page = self.initial_vbox (_("Queue Not Shared"),
00030                                   _("The CUPS printer on the server is not "
00031                                     "shared."))
00032         troubleshooter.new_page (page, self)

Here is the call graph for this function:


Member Function Documentation

Reimplemented from troubleshoot.base.Question.

Definition at line 72 of file NetworkCUPSPrinterShared.py.

00072 
00073     def can_click_forward (self):
00074         return False

Reimplemented from troubleshoot.base.Question.

Definition at line 78 of file NetworkCUPSPrinterShared.py.

00078 
00079     def cancel_operation (self):
00080         self.op.cancel ()

Reimplemented from troubleshoot.base.Question.

Definition at line 75 of file NetworkCUPSPrinterShared.py.

00075 
00076     def collect_answer (self):
00077         return self.answers

def troubleshoot.base.Question.connect_signals (   self,
  handler 
) [inherited]
Returns True if this page should be displayed, or False
if it should be skipped.

Reimplemented from troubleshoot.base.Question.

Definition at line 33 of file NetworkCUPSPrinterShared.py.

00033 
00034     def display (self):
00035         self.answers = {}
00036         answers = self.troubleshooter.answers
00037         if (answers.has_key ('remote_cups_queue_listed') and
00038             answers['remote_cups_queue_listed'] == False):
00039             return False
00040 
00041         parent = self.troubleshooter.get_window ()
00042         if not answers.has_key ('remote_cups_queue_attributes'):
00043             if not (answers.has_key ('remote_server_try_connect') and
00044                     answers.has_key ('remote_cups_queue')):
00045                 return False
00046 
00047             try:
00048                 host = answers['remote_server_try_connect']
00049                 self.op = TimedOperation (cups.Connection,
00050                                           kwargs={"host": host},
00051                                           parent=parent)
00052                 c = self.op.run ()
00053                 self.op = TimedOperation (c.getPrinterAttributes,
00054                                           args=(answers['remote_cups_queue'],),
00055                                           parent=parent)
00056                 attr = self.op.run ()
00057             except RuntimeError:
00058                 return False
00059             except cups.IPPError:
00060                 return False
00061 
00062             self.answers['remote_cups_queue_attributes'] = attr
00063         else:
00064             attr = answers['remote_cups_queue_attributes']
00065 
00066         if attr.has_key ('printer-is-shared'):
00067             # CUPS >= 1.2
00068             if not attr['printer-is-shared']:
00069                 return True
00070 
00071         return False

def troubleshoot.base.Question.initial_vbox (   self,
  title = '',
  text = '' 
) [inherited]

Helper functions.

Definition at line 66 of file base.py.

00066 
00067     def initial_vbox (self, title='', text=''):
00068         vbox = gtk.VBox ()
00069         vbox.set_border_width (12)
00070         vbox.set_spacing (12)
00071         if title:
00072             s = '<span weight="bold" size="larger">' + title + '</span>\n\n'
00073         else:
00074             s = ''
00075         s += text
00076         label = gtk.Label (s)
00077         label.set_alignment (0, 0)
00078         label.set_line_wrap (True)
00079         label.set_use_markup (True)
00080         vbox.pack_start (label, False, False, 0)
00081         return vbox

Here is the caller graph for this function:


Member Data Documentation

Definition at line 34 of file NetworkCUPSPrinterShared.py.

Definition at line 48 of file NetworkCUPSPrinterShared.py.

Reimplemented in troubleshoot.CheckPrinterSanity.CheckPrinterSanity.

Definition at line 41 of file base.py.


The documentation for this class was generated from the following file: