Printer library. |
modules/Printerlib.ycp |
Some utility functions for printer conf. tools. | |
|
|
This module has an unstable interface. |
System paper size, taken from system locales. 0 for a4 and 1 for letter. -1 for unknown. Use function Printerlib::getDefaultPaperSize for accessing this function.
Info about USB devices got through CUPS backend
Contains lists of [
set to true after function Read had been called.
Base directory of printconf's data files
list of HP all-in-one models
List of probed bluetooth devices (in order to keep their names)
Set the USB devices info got through the CUPS backend
- Parameters:
-
di a list of found CUPS devices
Return the currently stored CUPS USB devices info
Get info about device connected to USB port from CUPS backed
- Parameters:
-
device string USB device to examine
- Return value:
-
a list containing CUPS device name, Printer model and UNIX-like device
Get the list of all HP all-in-one models
- Return value:
-
all-in-one models
Inform user that function isn't available during preparatino of AI via a popup
Sends sequence to wake up Epson stylus usb printers.
- Parameters:
-
device Device to send sequence to. Should be /dev/usblp? (or /dev/usb/lp?)
Get list of all PTAL devices
- Return value:
-
a list of PTAL devices
Get list of all HPLIP devices
- Return value:
-
a list of HPLIP devices
Get URI of ptal device
- Parameters:
-
model string device model identification
- Return value:
-
ptal uri or nil if no ptal device found
Get URI of HPLIP device
- Parameters:
-
model string device model identification
- Return value:
-
ptal uri or nil if no ptal device found
Calls escputil to find out exact model of Epson stylus printer.
- Parameters:
-
device USB Device to examine.
- Return value:
-
Printer model. If unsuccessful, returns "Stylus".
Test device by sending hello world to it. See test_device for details.
- Parameters:
-
dev device to test (/dev/lp0)
Test remote queue accessibility if username and password needed
- Parameters:
-
wg string workgroup for samba test hname string hostname of remote host rname string name of remote queue user string username to access remote queue pass string password to access remote queue type string "samba" or "novell"
Test of the connection. See test_remote_lpd for details.
- Parameters:
-
hname host name rname name of remote queue type queue type port TCP port
Printer uri = type://device where type is one of parallel, serial, usb, file, lpd, novell, samba, ipp, socket, http and device is depending on the type. For parallel, serial, usb, file it is file name. For lpd it is server/queue. For socket it is server, for ipp, http it is server/path_to_queue, for samba, novell it is "user:pass@server/queuename" (user, pass is optional).
- Parameters:
-
uri printer uri (file://tmp/pr.tmp, lpd://d11.suse.de)
- Return value:
-
type of printer or ""
Get printer device from its uri.
- Parameters:
-
uri printer uri
- Return value:
-
device
- See
-
getUriType
Get printer remote queue. Input to this function must be valid because it just takes the part of uri after the last slash. Should be used for: lpd, novell, samba, http/ipp.
- Parameters:
-
uri printer uri
- Return value:
-
remote queue
- See
-
getUriType
Get port number from URI.
- Parameters:
-
uri printer uri
- Return value:
-
port
Get any parameter from uri. Suppose uri has form: method://user:pass@address/path?key=value+key=value+key=value
- Parameters:
-
uri printer uri key key to extract
- Return value:
-
value
Get printer baud rate from uri. Applies to serial printers only. Does not check if passed uri belongs to serial printer.
- Parameters:
-
uri printer uri
- Return value:
-
baud rate
- See
-
getUriType
Get host name from uri. Applies to lpd, novell, samba, ipp/http, socket
- Parameters:
-
uri printer uri
- Return value:
-
hostname
- See
-
getUriType
Get uri user name and password. Applies to samba, novell.
- Parameters:
-
uri printer uri
- Return value:
-
[ username, password, workgroup ]
- See
-
getUriType
Get nice name for printer uri
- Parameters:
-
uri printer uri
- Return value:
-
nice name of printer uri (device, network printer...)
replace string "%20" to " "
- Parameters:
-
device string name of device to replace (from cups format) show_pass
- Return value:
-
visible_string
Get nice name of some device.
- Parameters:
-
dev device detected boolean set to true if displaying detected dialog
- Return value:
-
device nice name
get paper size from system and returns `a4 for a4 or `letter for letter
- Return value:
-
`a4 for a4, `letter for letter
Function to return map of bluetooth devices
- Return value:
-
bluetooth devices
Function to detect bluetooth devices
- Return value:
-
bluetooth devices