Changeset f6e2532 for server


Ignore:
Timestamp:
Dec 23, 2011, 1:09:01 PM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
aded2d1
Parents:
94a4825
git-author:
Jessica B. Hamrick <jhamrick@…> (12/23/11 13:09:01)
git-committer:
Jessica B. Hamrick <jhamrick@…> (12/23/11 13:09:01)
Message:

Constants; small changes in printer

Location:
server/lib/gutenbach
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/ipp/__init__.py

    r5e44432 rf6e2532  
    11from attribute import Attribute
    22from attributegroup import AttributeGroup
    3 from constants import Tags, StatusCodes
    43from request import Request
    54from value import Value
     5
    66import constants
     7from constants import *
     8
    79import exceptions as errors
    810
     
    1113
    1214__all__ = ['Attribute', 'AttributeGroup', 'Request', 'Value',
    13            'Tags', 'StatusCodes', 'ops', 'errors', 'constants']
     15           'ops', 'errors', 'constants']
     16__all__.extend(constants.__all__)
  • server/lib/gutenbach/ipp/constants.py

    r94a4825 rf6e2532  
     1__all__ = [
     2    'Misc',
     3    'JobStates',
     4    'PrinterStates',
     5    'Operations',
     6    'SuccessCodes',
     7    'ClientErrorCodes',
     8    'ServerErrorCodes',
     9    'ErrorCodes',
     10    'StatusCodes',
     11    'CUPSPrinterType',
     12    'AttributeTags',
     13    'OutOfBandTags',
     14    'IntegerTags',
     15    'OctetStringTags',
     16    'CharacterStringTags',
     17    'operations_attribute_value_tags',
     18    'job_attribute_value_tags',
     19    'printer_attribute_value_tags',
     20]
     21
    122class Misc():
    223    """Miscellaneous config options for the IPP server.
     
    311332    MEMBER_ATTR_NAME      = 0x4a
    312333
    313 class Tags(AttributeTags, OutOfBandTags, IntegerTags, OctetStringTags, CharacterStringTags):
    314     pass
    315 
    316334operations_attribute_value_tags = {
    317335    'attributes-charset': CharacterStringTags.CHARSET,
     
    349367    "pdl-override-supported": CharacterStringTags.KEYWORD,
    350368    "printer-up-time": IntegerTags.INTEGER,
    351     "compression-supported": CharacterStringTags.KEYWORD
     369    "compression-supported": CharacterStringTags.KEYWORD,
     370    "multiple-operation-time-out": IntegerTags.INTEGER,
     371    "multiple-document-jobs-supported": IntegerTags.BOOLEAN
    352372    }
    353373   
  • server/lib/gutenbach/server/printer.py

    rcad7502 rf6e2532  
    3232        "pdl-override-supported",
    3333        "printer-up-time",
    34         "compression-supported"
     34        "compression-supported",
     35        "multiple-operation-time-out",
     36        "multiple-document-jobs-supported",
    3537    ]
     38
     39    operations = [
     40        "print-job",
     41        "complete-job",
     42        "start-job",
     43        "get-job",
     44        "get-jobs",
     45    ]
     46       
    3647
    3748    #def __init__(self, name, card, mixer):
     
    102113    def ipp_versions_supported(self):
    103114        return ("1.0", "1.1")
     115
    104116    # XXX: We should query ourself for the supported operations
    105 
    106117    @property
    107118    def operations_supported(self):
    108         return 0xa # get-jobs
     119        return ipp.Operations.GET_JOBS # get-jobs
    109120
    110121    @property
     
    151162    def compression_supported(self):
    152163        return "none"
     164
     165    @property
     166    def multiple_operation_time_out(self):
     167        return 240
     168
     169    @property
     170    def multiple_document_jobs_supported(self):
     171        return False
    153172
    154173    def get_printer_attributes(self, request):
     
    159178
    160179    ## Printer operations
    161     @property
    162     def next_jobid(self):
    163         self._next_jobid += 1
    164         return self._next_jobid
    165180
    166181    def print_job(self, job):
    167         jobid = self.next_jobid
     182        jobid = self._next_jobid
     183        self._next_jobid += 1
    168184        self.active_jobs.append(jobid)
    169185        self.jobs[jobid] = job
Note: See TracChangeset for help on using the changeset viewer.