資源簡介
惠普打印機linux打印驅動,便于用戶在使用linux打印機時找不到對應的驅動信息,使用文件中的PPD文件即可使用
代碼片段和文件信息
#!/usr/bin/env?python
#?-*-?coding:?utf-8?-*-
#
#?(c)?Copyright?2003-2015?HP?Development?Company?L.P.
#
#?This?program?is?free?software;?you?can?redistribute?it?and/or?modify
#?it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
#?the?Free?Software?Foundation;?either?version?2?of?the?License?or
#?(at?your?option)?any?later?version.
#
#?This?program?is?distributed?in?the?hope?that?it?will?be?useful
#?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
#?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
#?GNU?General?Public?License?for?more?details.
#
#?You?should?have?received?a?copy?of?the?GNU?General?Public?License
#?along?with?this?program;?if?not?write?to?the?Free?Software
#?Foundation?Inc.?59?Temple?Place?Suite?330?Boston?MA??02111-1307?USA
#
#?Author:?Don?Welch?Naga?Samrat?Chowdary?Narla
#
__version__?=?‘5.0‘
__title__?=?‘Printer?Cartridge?Alignment?Utility‘
__mod__?=?‘hp-align‘
__doc__?=?“Cartridge?alignment?utility?for?HPLIP?supported?inkjet?printers.?(Note:?Not?all?printers?require?the?use?of?this?utility).“
#?Std?Lib
import?sys
import?re
import?getopt
import?operator
import?os
#?Local
from?base.g?import?*
from?base?import?device?status?utils?maint?tui?module
from?prnt?import?cups
try:
????from?importlib?import?import_module
except?ImportError?as?e:
????log.debug(e)
????from?base.utils?import?dyn_import_mod?as?import_module
def?enterAlignmentNumber(letter?hortvert?colors?line_count?maximum):
????ok?value?=?tui.enter_range(“From?the?printed?Alignment?page?Enter?the?best?aligned?value?for?line?%s?(1-%d):?“?%
????????????????????????(letter?maximum)
????????????????????????1
????????????????????????maximum)
????if?not?ok:
????????sys.exit(0)
????return?ok?value
def?enterPaperEdge(maximum):
????ok?value?=?tui.enter_range(“Enter?numbered?arrow?that?is?best?aligned?with?the?paper?edge?(1-%d):?“
????????????????????????%?maximum
????????????????????????1
????????????????????????maximum)
????if?not?ok:
????????sys.exit(0)
????return?ok?value
def?colorAdj(line?maximum):
????ok?value?=?tui.enter_range(“Enter?the?numbered?box?on?line?%s?that?is?best?color?matched?to?the?background?color?(1-%d):?“?%
????????????????????????(line?maximum)
????????????????????????1
????????????????????????maximum)
????if?not?ok:
????????sys.exit(0)
????return?ok?value
def?bothPensRequired():
????log.error(“Cannot?perform?alignment?with?0?or?1?cartridges?installed.\nPlease?install?both?cartridges?and?try?again.“)
def?invalidPen():
????log.error(“Invalid?cartridge(s)?installed.\nPlease?install?valid?cartridges?and?try?again.“)
def?invalidPen2():
????log.error(“Invalid?cartridge(s)?installed.?Cannot?align?with?only?the?photo?cartridge?installed.\nPlease?install?other?cartridges?and?try?again.“)
def?aioUI1():
????log.info(“To?perform?alignment?you?will?need?the?alignment?page?that?is?automatically\nprinted?after?you?install?a?print?cartridge.“)
????log.info(“\np\t\tPrint?the?a
評論
共有 條評論