printer configuration tool
|
modules/Printerdb.ycp
|
|
Defines for handling PPD files and database of PPD files
|
|
|
|
Imports
- CommandLine
- Label
- Mode
- Package
- Printerlib
- Report
- Stage
Global Variables
Global Functions
- AreDriversInstalled ()
- GetDriverPackages ()
- GetDriversAreInstalled ()
- GetSupportedFilters ()
- InstallDrivers ()
- ListAllPpds ()
- PpdInfo (string file)
- SetDriverPackages (list<string> packages)
- SetDriversAreInstalled (boolean installed)
- SetSupportedFilters (list<string> filters)
- getAutoPpdFile (string vendor_db, string device_db)
- getFileFromNickName (string vendor_db, string device_db, string nick, string lang)
- getFilesFromNickName (string vendor_db, string device_db, string nick, string lang)
- getFoomaticDefaultQueue (list<map> queues)
- getPpdFileOptions (string filename)
- getPpdFiles (string vendor_db, string device_db)
- getUpdatedPpdFile (map<string,any> entry)
- loadFoomaticIfNeeded ()
- processPpdFiles (string dir)
- sortPpds (string vendor_db, string device_db)
Local Variables
Local Functions
|
|
|
|
local known_filters -> list<string>
|
|
List of printing filters known by the current spooler
nil if all filters are supported
|
local drivers_installed -> boolean
|
|
True if printer drivers have already been installed
|
local available_packages -> map<string,boolean>
|
|
Map of packages that haev checked to be availabel (package name -> boolean)
|
local driver_packages -> list<string>
|
|
Packages containing driver for current spooler
|
global foomatic -> map<string,map>
|
|
map of foomatic printers database
|
local Language2Encoding (string language) -> string
|
|
Get the default encoding of the PPD file according to the language
- Parameters:
|
language |
string language in the form it is present in PPD file |
- Return value:
|
|
encoding in the form it is present in PPD file |
|
local Code2Language (string code) -> string
|
|
Translate the country code (eg. cs_CZ) to language name "czech"
- Parameters:
- Return value:
|
local PPDenc2UIenc (string ppd_enc) -> string
|
|
Get the characters encoding from the form in it is present in PPD file
to the form that can be passed to iconv
- Parameters:
|
ppd_enc |
string encoding in the form for PPD file |
- Return value:
|
|
encoding in the form for iconv |
|
global SetDriverPackages (list<string> packages) -> void
|
|
Set list of packages containing drivers for the current spooler
- Parameters:
|
packages |
a list of package names |
|
global GetDriverPackages () -> list<string>
|
|
Get list of packages containing drivers for the current spooler
- Return value:
|
global SetSupportedFilters (list<string> filters) -> void
|
|
Set the list of supported filters
- Parameters:
|
filters |
a list of known filters or nil if all filters are known |
|
global GetSupportedFilters () -> list<string>
|
|
Get the list of supported filters
- Return value:
|
|
a list of known filters or nil if all filters are known |
|
global SetDriversAreInstalled (boolean installed) -> void
|
|
Set the info if packages with drivers were installed
- Parameters:
|
installed |
boolean saying if the driver packages have been installed |
|
global GetDriversAreInstalled () -> boolean
|
|
Get the info if packages with drivers were installed
- Return value:
|
|
saying if the driver packages have been installed |
|
global getFilesFromNickName (string vendor_db, string device_db, string nick, string lang) -> list<string>
|
|
Get file names of all PPD files for specified model with the specified
nick name
- Parameters:
|
vendor_db |
string database key of the vendor |
|
device_db |
string database key of the model |
|
nick |
string nick name |
|
lang |
string preferred language version |
- Return value:
|
|
a list of all files with the specified nick name |
|
global getFileFromNickName (string vendor_db, string device_db, string nick, string lang) -> string
|
|
Get file name of the PPD files for specified model with the specified
nick name
- Parameters:
|
vendor_db |
string database key of the vendor |
|
device_db |
string database key of the model |
|
nick |
string nick name |
|
lang |
string preferred language of the PPD file |
- Return value:
|
|
file with the specified nick name |
|
global getPpdFileOptions (string filename) -> list<map>
|
|
Get the options of the PPD file
- Parameters:
|
filename |
string file name of the PPD file |
- Return value:
|
|
a list of all options of the PPD file (in UTF-8) |
|
global getFoomaticDefaultQueue (list<map> queues) -> string
|
|
Get proposed default queue when using foomatic db
- Parameters:
- Return value:
|
|
proposed default queue name |
|
global loadFoomaticIfNeeded () -> void
|
|
Check whether foomatic database has been loaded, and if not, then
load it
|
global ListAllPpds () -> list<map<string,string> >
|
|
List all PPD files
- Return value:
|
|
a list of sorted PPD files (maps containing vendor_db, model_db,
nick name and file name |
|
global sortPpds (string vendor_db, string device_db) -> list<string>
|
|
Sort PPD files for specified model according to preference list
- Parameters:
|
vendor_db |
string vendor database key |
|
device_db |
string model database key |
- Return value:
|
|
a list of sorted PPD nicknames |
|
global getAutoPpdFile (string vendor_db, string device_db) -> string
|
|
Get the PPD file for automatic installation
- Parameters:
|
vendor_db |
string vendor database key |
|
device_db |
string model database key |
- Return value:
|
|
name of the PPD file (filename),
nil if no is usable |
|
global getUpdatedPpdFile (map<string,any> entry) -> map<string,any>
|
|
Get PPD file updated according to printer options and add it's name to
printer description map
- Parameters:
- Return value:
|
global getPpdFiles (string vendor_db, string device_db) -> map
|
|
get configurations, which may be usable for detected printer
- Parameters:
|
vendor_db |
string name of printer vendor |
|
device_db |
string printer model name |
- Return value:
|
|
of ppd files (filename -> description) |
|
global processPpdFiles (string dir) -> boolean
|
|
Process downloaded PPD files
- Parameters:
|
dir |
string directory with downloaded PPD files |
- Return value:
|
global AreDriversInstalled () -> boolean
|
|
Check if drivers for current spooler are installed
- Return value:
|
|
true if all available drivers are installed |
|
global InstallDrivers () -> boolean
|
|
Install drivers for current spooler, reread database
- Return value:
|
global PpdInfo (string file) -> map
|
|
Get PPD file info
- Parameters:
|
file |
string filename to get info from |
- Return value:
|