Git Product home page Git Product logo

Comments (4)

DrPsychick avatar DrPsychick commented on June 18, 2024

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.

burnbabyburn avatar burnbabyburn commented on June 18, 2024

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

vajonam avatar vajonam commented on June 18, 2024

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.

DrPsychick avatar DrPsychick commented on June 18, 2024

should be fine now, thanks for the extremely fast feedback @burnbabyburn !

from docker-cups-airprint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.