Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Public Attributes
asyncpk1.UI Class Reference

List of all members.

Public Member Functions

def __init__
def __del__
def destroy
def button_clicked
def connected
def connection_error
def fetch_clicked
def got_devices
def get_devices_error
def cancel_clicked
def job_canceled
def cancel_job_error
def get_file_clicked
def got_file
def get_file_error
def harmless_clicked
def got_jobs
def get_jobs_error

Public Attributes

 fetch_button
 cancel_button
 get_file_button
 harmless_button
 conn
 my_file

Detailed Description

Definition at line 557 of file asyncpk1.py.


Constructor & Destructor Documentation

def asyncpk1.UI.__init__ (   self)

Definition at line 558 of file asyncpk1.py.

00558 
00559         def __init__ (self):
00560             w = gtk.Window ()
00561             v = gtk.VBox ()
00562             w.add (v)
00563             b = gtk.Button ("Go")
00564             v.pack_start (b)
00565             b.connect ("clicked", self.button_clicked)
00566             b = gtk.Button ("Fetch")
00567             v.pack_start (b)
00568             b.connect ("clicked", self.fetch_clicked)
00569             b.set_sensitive (False)
00570             self.fetch_button = b
00571             b = gtk.Button ("Cancel job")
00572             v.pack_start (b)
00573             b.connect ("clicked", self.cancel_clicked)
00574             b.set_sensitive (False)
00575             self.cancel_button = b
00576             b = gtk.Button ("Get file")
00577             v.pack_start (b)
00578             b.connect ("clicked", self.get_file_clicked)
00579             b.set_sensitive (False)
00580             self.get_file_button = b
00581             b = gtk.Button ("Something harmless")
00582             v.pack_start (b)
00583             b.connect ("clicked", self.harmless_clicked)
00584             b.set_sensitive (False)
00585             self.harmless_button = b
00586             w.connect ("destroy", self.destroy)
00587             w.show_all ()
00588             self.conn = None
00589             debugprint ("+%s" % self)

Here is the call graph for this function:

def asyncpk1.UI.__del__ (   self)

Definition at line 590 of file asyncpk1.py.

00590 
00591         def __del__ (self):
00592             debug.debugprint ("-%s" % self)


Member Function Documentation

def asyncpk1.UI.button_clicked (   self,
  button 
)

Definition at line 603 of file asyncpk1.py.

00603 
00604         def button_clicked (self, button):
00605             if self.conn:
00606                 self.conn.destroy ()
00607 
00608             self.conn = PK1Connection (reply_handler=self.connected,
00609                                        error_handler=self.connection_error)

Here is the call graph for this function:

Here is the caller graph for this function:

def asyncpk1.UI.cancel_clicked (   self,
  button 
)

Definition at line 640 of file asyncpk1.py.

00640 
00641         def cancel_clicked (self, button):
00642             print "Cancel job..."
00643             self.conn.cancelJob (1,
00644                                  reply_handler=self.job_canceled,
00645                                  error_handler=self.cancel_job_error)

Here is the call graph for this function:

def asyncpk1.UI.cancel_job_error (   self,
  conn,
  exc 
)

Definition at line 653 of file asyncpk1.py.

00653 
00654         def cancel_job_error (self, conn, exc):
00655             if conn != self.conn:
00656                 print "Ignoring stale error for %s" % conn
00657                 return
00658 
00659             print "cancel error: %s" % repr (exc)

Here is the caller graph for this function:

def asyncpk1.UI.connected (   self,
  conn,
  result 
)

Definition at line 610 of file asyncpk1.py.

00610 
00611         def connected (self, conn, result):
00612             print "Connected"
00613             self.fetch_button.set_sensitive (True)
00614             self.cancel_button.set_sensitive (True)
00615             self.get_file_button.set_sensitive (True)
00616             self.harmless_button.set_sensitive (True)

Here is the caller graph for this function:

def asyncpk1.UI.connection_error (   self,
  conn,
  error 
)

Definition at line 617 of file asyncpk1.py.

00617 
00618         def connection_error (self, conn, error):
00619             print "Failed to connect"
00620             raise error

Here is the caller graph for this function:

def asyncpk1.UI.destroy (   self,
  window 
)

Definition at line 593 of file asyncpk1.py.

00593 
00594         def destroy (self, window):
00595             debugprint ("DESTROY: %s" % self)
00596             try:
00597                 self.conn.destroy ()
00598                 del self.conn
00599             except AttributeError:
00600                 pass
00601 
00602             gtk.main_quit ()

def asyncpk1.UI.fetch_clicked (   self,
  button 
)

Definition at line 621 of file asyncpk1.py.

00621 
00622         def fetch_clicked (self, button):
00623             print ("fetch devices...")
00624             self.conn.getDevices (reply_handler=self.got_devices,
00625                                   error_handler=self.get_devices_error)

Here is the call graph for this function:

Here is the caller graph for this function:

def asyncpk1.UI.get_devices_error (   self,
  conn,
  exc 
)

Definition at line 633 of file asyncpk1.py.

00633 
00634         def get_devices_error (self, conn, exc):
00635             if conn != self.conn:
00636                 print "Ignoring stale error"
00637                 return
00638 
00639             print "devices error: %s" % repr (exc)

Here is the caller graph for this function:

def asyncpk1.UI.get_file_clicked (   self,
  button 
)

Definition at line 660 of file asyncpk1.py.

00660 
00661         def get_file_clicked (self, button):
00662             self.my_file = file ("cupsd.conf", "w")
00663             self.conn.getFile ("/admin/conf/cupsd.conf", file=self.my_file,
00664                                reply_handler=self.got_file,
00665                                error_handler=self.get_file_error)

def asyncpk1.UI.get_file_error (   self,
  conn,
  exc 
)

Definition at line 673 of file asyncpk1.py.

00673 
00674         def get_file_error (self, conn, exc):
00675             if conn != self.conn:
00676                 print "Ignoring stale error"
00677                 return
00678 
00679             print "get file error: %s" % repr (exc)

def asyncpk1.UI.get_jobs_error (   self,
  exc 
)

Definition at line 690 of file asyncpk1.py.

00690 
00691         def get_jobs_error (self, exc):
00692             print "get jobs error: %s" % repr (exc)
00693 
    UI ()

Here is the caller graph for this function:

def asyncpk1.UI.got_devices (   self,
  conn,
  devices 
)

Definition at line 626 of file asyncpk1.py.

00626 
00627         def got_devices (self, conn, devices):
00628             if conn != self.conn:
00629                 print "Ignoring stale reply"
00630                 return
00631 
00632             print "got devices: %s" % devices

Here is the caller graph for this function:

def asyncpk1.UI.got_file (   self,
  conn,
  none 
)

Definition at line 666 of file asyncpk1.py.

00666 
00667         def got_file (self, conn, none):
00668             if conn != self.conn:
00669                 print "Ignoring stale reply for %s" % conn
00670                 return
00671 
00672             print "Got file"

def asyncpk1.UI.got_jobs (   self,
  conn,
  result 
)

Definition at line 684 of file asyncpk1.py.

00684 
00685         def got_jobs (self, conn, result):
00686             if conn != self.conn:
00687                 print "Ignoring stale reply from %s" % repr (conn)
00688                 return
00689             print result

Here is the caller graph for this function:

def asyncpk1.UI.harmless_clicked (   self,
  button 
)

Definition at line 680 of file asyncpk1.py.

00680 
00681         def harmless_clicked (self, button):
00682             self.conn.getJobs (reply_handler=self.got_jobs,
00683                                error_handler=self.get_jobs_error)

Here is the call graph for this function:

def asyncpk1.UI.job_canceled (   self,
  conn,
  none 
)

Definition at line 646 of file asyncpk1.py.

00646 
00647         def job_canceled (self, conn, none):
00648             if conn != self.conn:
00649                 print "Ignoring stale reply for %s" % conn
00650                 return
00651 
00652             print "Job canceled"

Here is the caller graph for this function:


Member Data Documentation

Definition at line 574 of file asyncpk1.py.

Definition at line 587 of file asyncpk1.py.

Definition at line 569 of file asyncpk1.py.

Definition at line 579 of file asyncpk1.py.

Definition at line 584 of file asyncpk1.py.

Definition at line 661 of file asyncpk1.py.


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