211. Printerlib

Some utility functions for printer conf. tools.

211.1. Summary of Module Globals

List of Global Functions

List of Global Variables

211.2. Global Functions

211.2.1. DisplayUnavailableAIPopup

Inform user that function isn't available during preparatino of AI via a popup

Return value

  • void

211.2.2. GetBluetoothDevices

Function to detect bluetooth devices

Return value

  • map<string,string> - bluetooth devices

211.2.3. GetCupsUsbDeviceInfo

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

211.2.4. GetCupsUsbDevicesInfo

Return the currently stored CUPS USB devices info

Return value

  • list<list<string> >

211.2.5. GetHPAllInOneModels

Get the list of all HP all-in-one models

Return value

  • list<string> - all-in-one models

211.2.6. ListBluetoothDevices

Function to return map of bluetooth devices

Return value

  • map<string,string> - bluetooth devices

211.2.7. SetCupsUsbDevicesInfo

Set the USB devices info got through the CUPS backend

Function parameters

  • list<list<string> > di

Return value

  • void

211.2.8. getDefaultPaperSize

get paper size from system and returns `a4 for a4 or `letter for letter

Return value

  • symbol - `a4 for a4, `letter for letter

211.2.9. getDeviceNiceName

Get nice name of some device.

Function parameters

  • string dev

  • boolean detected

Return value

  • string - device nice name

211.2.10. getEpsonUsbModel

Calls escputil to find out exact model of Epson stylus printer.

Function parameters

  • string device

Return value

  • string - Printer model. If unsuccessful, returns "Stylus".

211.2.11. getHplipDevices

Get list of all HPLIP devices

Return value

  • list<list<string> > - a list of HPLIP devices

211.2.12. getHplipUri

Get URI of HPLIP device

Function parameters

  • string model

Return value

  • string - ptal uri or nil if no ptal device found

211.2.13. getPtalDevices

Get list of all PTAL devices

Return value

  • list<list<string> > - a list of PTAL devices

211.2.14. getPtalUri

Get URI of ptal device

Function parameters

  • string model

Return value

  • string - ptal uri or nil if no ptal device found

211.2.15. getReplacedString

replace string "%20" to " "

Function parameters

  • string device

  • boolean show_pass

Return value

  • string - visible_string

211.2.16. getUriBaudrate

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

211.2.17. getUriDevice

Get printer device from its uri.

Function parameters

  • string uri

Return value

  • string - device

211.2.18. getUriHost

Get host name from uri. Applies to lpd, novell, samba, ipp/http, socket

Function parameters

  • string uri

Return value

  • string - hostname

211.2.19. getUriNiceName

Get nice name for printer uri

Function parameters

  • string uri

Return value

  • string - nice name of printer uri (device, network printer...)

211.2.20. getUriPort

Get port number from URI.

Function parameters

  • string uri

Return value

  • integer - port

211.2.21. 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.

Function parameters

  • string uri

Return value

  • string - remote queue

211.2.22. getUriUsernamePassWorkgroup

Get uri user name and password. Applies to samba, novell.

Function parameters

  • string uri

Return value

  • list - [ username, password, workgroup ]

211.2.23. getUriValue

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

211.2.24. testDevice

Test device by sending hello world to it. See test_device for details.

Function parameters

  • string dev

Return value

  • void

211.2.25. testRemote

Test of the connection. See test_remote_lpd for details.

Function parameters

  • string hname

  • string rname

  • string type

  • integer port

Return value

  • void

211.2.26. testRemoteUP

Test remote queue accessibility if username and password needed

Function parameters

  • string wg

  • string hname

  • string rname

  • string user

  • string pass

  • string type

Return value

  • void

211.3. Global Variables

211.3.1. baseDataDir

Base directory of printconf's data files

211.3.2. proposal_valid

set to true after function Read had been called.

211.4. Module Requirements

211.4.1. Module Imports

  • Arch
  • CommandLine
  • Directory
  • FileUtils
  • Label
  • Mode
  • Package
  • PackageSystem
  • Popup
  • Report
  • Service
  • String
  • URL

211.4.2. Module Includes

  • packages/common.ycp
  • printer/texts.ycp