Skip to content

Commit

Permalink
Correction for Brother BR-Script PPD files
Browse files Browse the repository at this point in the history
For the PPD list entries we do not consider the ModelName if it
contains "BR-Script", as in PPD files for Brother BR-Script printers
we want to have the Product entry, as this is most probably what the
printer reports as device ID (there is no explicit device ID entry in
the PPD file).
  • Loading branch information
tillkamppeter committed Nov 3, 2021
1 parent 85ed5aa commit 3d5cd35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyppd/ppd.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,14 @@ def standardize(model_name):
product_added = True
models += [product_standardized]

# Note that we do not consider the ModelName if it contains
# "BR-Script" here, as in PPD files for Brother BR-Script printers
# we want to have the Product entry, as this is most probably
# what the printer reports as device ID (there is no explicit device
# ID entry in the PPD file).
if (num_products == 1 and product_added and
(num_device_ids > 0 or modelname != None)):
(num_device_ids > 0 or
(modelname != None and ("br-script" not in modelname.lower())))):
# If there is only one Product line, it either contains the
# model described by the PPD's ModelName or NickName or something
# weird. So we will not add it. And if we have no device ID
Expand Down

0 comments on commit 3d5cd35

Please sign in to comment.