Comments (4)
It might be that a simple change could fix it:
if attrs['color-supported']:
-> if 'color-supported' in attrs:
Let me know if that helps @burnbabyburn , then I can update the code quickly.
from docker-cups-airprint.
@DrPsychick
Thx for the fix. Worked for me, but the Color is always true now!
I added some missing stuff from the specification and an else clause for the color. Maybe another possability is to use
if attrs.get('color-supported', True):
Someone needs to check the python code though
copies = Element('txt-record')
if 'copies' in attrs.get('job-creation-attributes-supported'):
copies.text = 'Copies=T'
else:
copies.text = 'Copies=F'
service.append(copies)
tbcp = Element('txt-record')
if 'tbcp' in attrs.get('port-monitor-supported'):
tbcp.text = 'TBCP=T'
else:
tbcp.text = 'TBCP=F'
service.append(tbcp)
staple = Element('txt-record')
if '4' in attrs.get('finishings-supported'):
staple.text = 'Staple=T'
else:
staple.text = 'Staple=F'
service.append(staple)
##THE OR PART IS BROKEN
punch = Element('txt-record')
punch.text = 'Punch=U'
if '3' in attrs.get('finishings-supported'):
punch.text = 'Punch=0'
if '70' or '71' or '72' or '73' in attrs.get('finishings-supported'):
punch.text = 'Punch=1'
if '74' or '75' or '76' or '77' in attrs.get('finishings-supported'):
punch.text = 'Punch=2'
if '78' or '79' or '80' or '81' in attrs.get('finishings-supported'):
punch.text = 'Punch=3'
if '82' or '83' or '84' or '85' in attrs.get('finishings-supported'):
punch.text = 'Punch=4'
service.append(punch)
##
bind = Element('txt-record')
if '7' in attrs.get('finishings-supported'):
bind.text = 'Bind=T'
else:
bind.text = 'Bind=F'
service.append(bind)
collate = Element('txt-record')
if 'separate-documents-collated-copies' in attrs.get('multiple-document-handling-supported'):
collate.text = 'Collate=T'
else:
collate.text = 'Collate=F'
service.append(collate)
duplex = Element('txt-record')
if 'sides' in attrs.get('job-creation-attributes-supported'):
duplex.text = 'Duplex=T'
else:
duplex.text = 'Duplex=F'
service.append(duplex)
color = Element('txt-record')
if attrs['color-supported']:
color.text = 'Color=T'
else:
color.text = 'Color=F'
service.append(color)
from docker-cups-airprint.
sorry the late response. I have moved to a printer that supports air print natively so haven't been using this container much recently.
from docker-cups-airprint.
should be fine now, thanks for the extremely fast feedback @burnbabyburn !
from docker-cups-airprint.
Related Issues (20)
- avahi stopping after sometime HOT 12
- update avahi service file for Location field HOT 4
- Work with IPVLAN ? HOT 6
- How should I set it up a virtual printer? HOT 1
- Update Ubuntu Version. HOT 3
- How can I add a printer shared through an Airport Express? HOT 2
- Dependency Dashboard
- Printers are not created on initial start/container setup, only on subsequent restarts HOT 6
- Slow to collect information about printer and a lot more after reboot. HOT 5
- Looking for MAINTAINERs HOT 5
- Switch to GitHub actions releases
- Work on homeassistant: portainer HOT 9
- http https version cups mismatch HOT 2
- "Bad Request" - Help configuring HOT 3
- broken pipe - cannot assign requested address HOT 9
- Would it be possible to include tea4cups? HOT 1
- Add possibility to install additional drivers (or to run custom init scripts) HOT 3
- Documentation Clarity HOT 2
- CUPS_USER_ADMIN / CUPS_USER_PASSWORD not working..Unable to login to the admin interface HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-cups-airprint.