Back to index

system-config-printer  1.3.9+20120706
Classes | Functions | Variables
newprinter Namespace Reference

Classes

class  NewPrinterGUI

Functions

def validDeviceURI
def moveClassMembers
def getCurrentClassMembers
def checkNPName
def ready
def busy
def on_delete_just_hide
def _singleton
def show_help
def on_signal

Variables

 PYSMB_AVAILABLE = True
tuple TEXT_adjust_firewall
 setup_printer = None
string devid = ""
tuple n = NewPrinterGUI()

Function Documentation

def newprinter._singleton (   x) [private]
If we don't know whether getPPDs() or getPPDs2() was used, this
function can unwrap an item from a list in either case.

Definition at line 135 of file newprinter.py.

00135 
00136 def _singleton (x):
00137     """If we don't know whether getPPDs() or getPPDs2() was used, this
00138     function can unwrap an item from a list in either case."""
00139     if isinstance (x, list):
00140         return x[0]
00141     return x

def newprinter.busy (   win)

Definition at line 128 of file newprinter.py.

00128 
00129 def busy (win):
00130     ready (win, gtk.gdk.Cursor(gtk.gdk.WATCH))

Here is the caller graph for this function:

def newprinter.checkNPName (   printers,
  name 
)

Definition at line 110 of file newprinter.py.

00110 
00111 def checkNPName(printers, name):
00112     if not name: return False
00113     name = unicode (name.lower())
00114     for printer in printers.values():
00115         if not printer.discovered and printer.name.lower()==name:
00116             return False
00117     return True

Here is the caller graph for this function:

Definition at line 100 of file newprinter.py.

00100 
00101 def getCurrentClassMembers(treeview):
00102     model = treeview.get_model()
00103     iter = model.get_iter_root()
00104     result = []
00105     while iter:
00106         result.append(model.get(iter, 0)[0])
00107         iter = model.iter_next(iter)
00108     result.sort()
00109     return result

Here is the caller graph for this function:

def newprinter.moveClassMembers (   treeview_from,
  treeview_to 
)

Definition at line 86 of file newprinter.py.

00086 
00087 def moveClassMembers(treeview_from, treeview_to):
00088     selection = treeview_from.get_selection()
00089     model_from, rows = selection.get_selected_rows()
00090     rows = [gtk.TreeRowReference(model_from, row) for row in rows]
00091 
00092     model_to = treeview_to.get_model()
00093 
00094     for row in rows:
00095         path = row.get_path()
00096         iter = model_from.get_iter(path)
00097         row_data = model_from.get(iter, 0)
00098         model_to.append(row_data)
00099         model_from.remove(iter)

Here is the caller graph for this function:

def newprinter.on_delete_just_hide (   widget,
  event 
)

Definition at line 131 of file newprinter.py.

00131 
00132 def on_delete_just_hide (widget, event):
00133     widget.hide ()
00134     return True # stop other handlers

def newprinter.on_signal (   args)

Definition at line 3706 of file newprinter.py.

03706 
03707     def on_signal (*args):
03708         gtk.main_quit ()

def newprinter.ready (   win,
  cursor = None 
)

Definition at line 118 of file newprinter.py.

00118 
00119 def ready (win, cursor=None):
00120     try:
00121         gdkwin = win.window
00122         if gdkwin:
00123             gdkwin.set_cursor (cursor)
00124             while gtk.events_pending ():
00125                 gtk.main_iteration ()
00126     except:
00127         nonfatalException ()

Definition at line 3664 of file newprinter.py.

03664 
03665 def show_help():
03666     print ("\nThis is the test/debug mode of the new-printer dialog of " \
03667            "system-config-printer.\n\n"
03668            "Options:\n\n"
03669            "  --setup-printer URI\n"
03670            "            Select the (detected) CUPS device URI on start up\n"
03671            "            and run the new-printer wizard for it.\n\n"
03672            "  --devid   Supply a device ID which should be used for the\n"
03673            "            setup of the new printer with \"--setup-printer\".\n"
03674            "            This can be any printer's ID, so that driver \n"
03675            "            selection can be tested for printers which are not\n"
03676            "            physically available.\n")
03677 
03678 gobject.type_register (NewPrinterGUI)

Returns True is the provided URI is valid.

Definition at line 77 of file newprinter.py.

00077 
00078 def validDeviceURI (uri):
00079     """Returns True is the provided URI is valid."""
00080     (scheme, rest) = urllib.splittype (uri)
00081     if scheme == None or scheme == '':
00082         return False
00083     return True
00084 
00085 # Both the printer properties window and the new printer window
# need to be able to drive 'class members' selections.

Variable Documentation

Definition at line 3690 of file newprinter.py.

Definition at line 3705 of file newprinter.py.

Definition at line 44 of file newprinter.py.

Definition at line 3689 of file newprinter.py.

Initial value:
00001 _("The firewall may need adjusting in order to "
00002                          "detect network printers.  Adjust the "
00003                          "firewall now?")

Definition at line 73 of file newprinter.py.