Back to index

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

List of all members.

Public Member Functions

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

Public Attributes

 answers
 op
 troubleshooter

Detailed Description

Definition at line 25 of file CheckLocalServerPublishing.py.


Constructor & Destructor Documentation

Definition at line 26 of file CheckLocalServerPublishing.py.

00026 
00027     def __init__ (self, troubleshooter):
00028         Question.__init__ (self, troubleshooter, "Is local server publishing?")
00029         vbox = self.initial_vbox (_("Server Not Exporting Printers"),
00030                                   _("Although one or more printers are marked "
00031                                     "as being shared, this print server is "
00032                                     "not exporting shared printers to the "
00033                                     "network.") + '\n\n' +
00034                                   _("Enable the 'Publish shared printers "
00035                                     "connected to this system' option in "
00036                                     "the server settings using the printing "
00037                                     "administration tool.") + ' ' +
00038                                   _(TEXT_start_print_admin_tool))
00039         troubleshooter.new_page (vbox, self)

Here is the call graph for this function:


Member Function Documentation

Reimplemented from troubleshoot.base.Question.

Definition at line 77 of file CheckLocalServerPublishing.py.

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

Reimplemented from troubleshoot.base.Question.

Definition at line 71 of file CheckLocalServerPublishing.py.

00071 
00072     def collect_answer (self):
00073         if self.displayed:
00074             return { 'local_server_exporting_printers': False }
00075 
00076         return {}

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 40 of file CheckLocalServerPublishing.py.

00040 
00041     def display (self):
00042         self.answers = {}
00043         cups.setServer ('')
00044         parent = self.troubleshooter.get_window ()
00045         try:
00046             c = self.timedop (cups.Connection, parent=parent).run ()
00047             printers = self.timedop (c.getPrinters, parent=parent).run ()
00048             if len (printers) == 0:
00049                 return False
00050 
00051             for name, printer in printers.iteritems ():
00052                 if printer.get ('printer-is-shared', False):
00053                     break
00054 
00055             attr = self.timedop (c.getPrinterAttributes,
00056                                  args=(name,),
00057                                  parent=parent).run ()
00058         except RuntimeError:
00059             return False
00060         except cups.IPPError:
00061             return False
00062 
00063         if not printer.get ('printer-is-shared', False):
00064             return False
00065 
00066         if attr.get ('server-is-sharing-printers', True):
00067             # server-is-sharing-printers is in CUPS 1.4
00068             return False
00069 
00070         return True

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:

Definition at line 80 of file CheckLocalServerPublishing.py.

00080 
00081     def timedop (self, *args, **kwargs):
00082         self.op = TimedOperation (*args, **kwargs)
00083         return self.op

Here is the caller graph for this function:


Member Data Documentation

Definition at line 41 of file CheckLocalServerPublishing.py.

Definition at line 81 of file CheckLocalServerPublishing.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: