Some utility functions for printer conf. tools.
List of Global Functions
DisplayUnavailableAIPopup - Inform user that function isn't available during preparatino of AI via a popup
GetBluetoothDevices - Function to detect bluetooth devices
GetCupsUsbDeviceInfo - Get info about device connected to USB port from CUPS backed
GetCupsUsbDevicesInfo - Return the currently stored CUPS USB devices info
GetHPAllInOneModels - Get the list of all HP all-in-one models
ListBluetoothDevices - Function to return map of bluetooth devices
SetCupsUsbDevicesInfo - Set the USB devices info got through the CUPS backend
getDefaultPaperSize - get paper size from system and returns `a4 for a4 or `letter for letter
getDeviceNiceName - Get nice name of some device.
getEpsonUsbModel - Calls escputil to find out exact model of Epson stylus printer.
getHplipDevices - Get list of all HPLIP devices
getHplipUri - Get URI of HPLIP device
getPtalDevices - Get list of all PTAL devices
getPtalUri - Get URI of ptal device
getReplacedString - replace string "%20" to " "
getUriBaudrate - Get printer baud rate from uri. Applies to serial printers only. Does not check if passed uri belongs to serial printer.
getUriDevice - Get printer device from its uri.
getUriHost - Get host name from uri. Applies to lpd, novell, samba, ipp/http, socket
getUriNiceName - Get nice name for printer uri
getUriPort - Get port number from URI.
getUriRemoteQueue - 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.
getUriType - 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).
getUriUsernamePassWorkgroup - Get uri user name and password. Applies to samba, novell.
getUriValue - Get any parameter from uri. Suppose uri has form: method://user:pass@address/path?key=value+key=value+key=value
testDevice - Test device by sending hello world to it. See test_device for details.
testRemote - Test of the connection. See test_remote_lpd for details.
testRemoteUP - Test remote queue accessibility if username and password needed
List of Global Variables
baseDataDir - Base directory of printconf's data files
proposal_valid - set to true after function Read had been called.
Inform user that function isn't available during preparatino of AI via a popup
Return value
void
Function to detect bluetooth devices
Return value
map<string,string> - bluetooth devices
Get info about device connected to USB port from CUPS backed
Function parameters
string device
Return value
list<string> - a list containing CUPS device name, Printer model and UNIX-like device
Return the currently stored CUPS USB devices info
Return value
list<list<string> >
Get the list of all HP all-in-one models
Return value
list<string> - all-in-one models
Function to return map of bluetooth devices
Return value
map<string,string> - bluetooth devices
Set the USB devices info got through the CUPS backend
Function parameters
list<list<string> > di
Return value
void
get paper size from system and returns `a4 for a4 or `letter for letter
Return value
symbol - `a4 for a4, `letter for letter
Get nice name of some device.
Function parameters
string dev
boolean detected
Return value
string - device nice name
Calls escputil to find out exact model of Epson stylus printer.
Function parameters
string device
Return value
string - Printer model. If unsuccessful, returns "Stylus".
Get list of all HPLIP devices
Return value
list<list<string> > - a list of HPLIP devices
Get URI of HPLIP device
Function parameters
string model
Return value
string - ptal uri or nil if no ptal device found
Get list of all PTAL devices
Return value
list<list<string> > - a list of PTAL devices
Get URI of ptal device
Function parameters
string model
Return value
string - ptal uri or nil if no ptal device found
replace string "%20" to " "
Function parameters
string device
boolean show_pass
Return value
string - visible_string
Get printer baud rate from uri. Applies to serial printers only. Does not check if passed uri belongs to serial printer.
Function parameters
string uri
Return value
integer - baud rate
Get printer device from its uri.
Function parameters
string uri
Return value
string - device
Get host name from uri. Applies to lpd, novell, samba, ipp/http, socket
Function parameters
string uri
Return value
string - hostname
Get nice name for printer uri
Function parameters
string uri
Return value
string - nice name of printer uri (device, network printer...)
Get port number from URI.
Function parameters
string uri
Return value
integer - port
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.
Function parameters
string uri
Return value
string - remote queue
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).
Function parameters
string uri
Return value
string - type of printer or ""
Get uri user name and password. Applies to samba, novell.
Function parameters
string uri
Return value
list - [ username, password, workgroup ]
Get any parameter from uri. Suppose uri has form: method://user:pass@address/path?key=value+key=value+key=value
Function parameters
string uri
string key
Return value
string - value
Test device by sending hello world to it. See test_device for details.
Function parameters
string dev
Return value
void
Test of the connection. See test_remote_lpd for details.
Function parameters
string hname
string rname
string type
integer port
Return value
void