Back to index

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

List of all members.

Public Member Functions

def __init__
def display
def collect_answer
def cancel_operation
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 27 of file VerifyPackages.py.


Constructor & Destructor Documentation

def troubleshoot.VerifyPackages.VerifyPackages.__init__ (   self,
  troubleshooter 
)

Definition at line 28 of file VerifyPackages.py.

00028 
00029     def __init__ (self, troubleshooter):
00030         Question.__init__ (self, troubleshooter, "Verify packages")
00031         troubleshooter.new_page (gtk.Label (), self)


Member Function Documentation

Reimplemented from troubleshoot.base.Question.

Definition at line 74 of file VerifyPackages.py.

00074 
00075     def cancel_operation (self):
00076         self.op.cancel ()

Reimplemented from troubleshoot.base.Question.

Definition at line 71 of file VerifyPackages.py.

00071 
00072     def collect_answer (self):
00073         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 32 of file VerifyPackages.py.

00032 
00033     def display (self):
00034         self.answers = {}
00035         packages_verification = {}
00036 
00037         package_manager="/bin/rpm"
00038         if not os.access (package_manager, os.X_OK):
00039             return False
00040 
00041         packages = ["cups",
00042                     "foomatic",
00043                     "gutenprint",
00044                     "hpijs",
00045                     "hplip",
00046                     "system-config-printer"]
00047         null = file ("/dev/null", "r+")
00048         parent = self.troubleshooter.get_window ()
00049 
00050         new_environ = os.environ.copy()
00051         new_environ['LC_ALL'] = "C"
00052 
00053         for package in packages:
00054             verification_args = [package_manager, "-V", package]
00055             try:
00056                 self.op = TimedSubprocess (parent=parent,
00057                                            args=verification_args,
00058                                            close_fds=True,
00059                                            env=new_environ,
00060                                            stdin=null,
00061                                            stdout=subprocess.PIPE,
00062                                            stderr=null)
00063                 (verif_stdout, verif_stderr, result) = self.op.run ()
00064             except:
00065                 # Problem executing command.
00066                 return False
00067             packages_verification[package] = verif_stdout[:-1]
00068 
00069         self.answers['packages_verification'] = packages_verification
00070         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 33 of file VerifyPackages.py.

Definition at line 55 of file VerifyPackages.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: