Ignore:
Timestamp:
Dec 23, 2011, 9:37:39 PM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
1037115
Parents:
b828a96
git-author:
Jessica B. Hamrick <jhamrick@…> (12/23/11 21:37:39)
git-committer:
Jessica B. Hamrick <jhamrick@…> (12/23/11 21:37:39)
Message:

Reorganization

File:
1 moved

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/ipp/attributes/job.py

    rb828a96 r793432f  
    11__all__ = [
     2    'JobPriority',
     3    'JobHoldUntil',
     4    'JobSheets',
     5    'MultipleDocumentHandling',
     6    'Copies',
     7    'Finishings',
     8    'PageRanges',
     9    'Sides',
     10    'NumberUp',
     11    'OrientationRequested',
     12    'Media',
     13    'PrinterResolution',
     14    'PrintQuality',
     15
    216    'JobUri',
    317    'JobId',
     
    3246]
    3347
    34 from ..attribute import Attribute
    35 from ..value import Value
    36 from ..exceptions import ClientErrorAttributes
    37 from ..constants import *
     48from .. import Attribute
     49from .. import Value
     50from .. import errors
     51from .. import IntegerTags, CharacterStringTags
     52
     53def JobPriority(val):
     54    """4.2.1 job-priority (integer(1:100))
     55
     56    This attribute specifies a priority for scheduling the Job. A
     57    higher value specifies a higher priority. The value 1 indicates
     58    the lowest possible priority. The value 100 indicates the highest
     59    possible priority. Among those jobs that are ready to print, a
     60    Printer MUST print all jobs with a priority value of n before
     61    printing those with a priority value of n-1 for all n.
     62
     63    If the Printer object supports this attribute, it MUST always
     64    support the full range from 1 to 100. No administrative
     65    restrictions are permitted. This way an end-user can always make
     66    full use of the entire range with any Printer object. If
     67    privileged jobs are implemented outside IPP/1.1, they MUST have
     68    priorities higher than 100, rather than restricting the range
     69    available to end-users.
     70
     71    If the client does not supply this attribute and this attribute is
     72    supported by the Printer object, the Printer object MUST use the
     73    value of the Printer object's 'job-priority-default' at job
     74    submission time (unlike most Job Template attributes that are used
     75    if necessary at job processing time).
     76   
     77    The syntax for the 'job-priority-supported' is also
     78    integer(1:100).  This single integer value indicates the number of
     79    priority levels supported. The Printer object MUST take the value
     80    supplied by the client and map it to the closest integer in a
     81    sequence of n integers values that are evenly distributed over the
     82    range from 1 to 100 using the formula:
     83
     84        roundToNearestInt((100x+50)/n)
     85
     86    where n is the value of 'job-priority-supported' and x ranges from
     87    0 through n-1.
     88
     89    For example, if n=1 the sequence of values is 50; if n=2, the
     90    sequence of values is: 25 and 75; if n = 3, the sequence of values
     91    is: 17, 50 and 83; if n = 10, the sequence of values is: 5, 15,
     92    25, 35, 45, 55, 65, 75, 85, and 95; if n = 100, the sequence of
     93    values is: 1, 2, 3, ... 100.
     94
     95    If the value of the Printer object's 'job-priority-supported' is
     96    10 and the client supplies values in the range 1 to 10, the
     97    Printer object maps them to 5, in the range 11 to 20, the Printer
     98    object maps them to 15, etc.
     99
     100    """
     101   
     102   
     103    return Attribute(
     104        'job-priority',
     105        [Value(IntegerTags.INTEGER), val])
     106
     107def JobHoldUntil(val):
     108    """4.2.2 job-hold-until (type3 keyword | name (MAX))
     109   
     110    """
     111
     112    raise errors.ClientErrorAttributes, "job-hold-until"
     113   
     114def JobSheets(val):
     115    """4.2.3 job-sheets (type3 keyword | name(MAX))
     116
     117    """
     118   
     119    raise errors.ClientErrorAttributes, "job-sheets"
     120
     121def MultipleDocumentHandling(val):
     122    """4.2.4 multiple-document-handling (type2 keyword)
     123
     124    """
     125
     126    raise errors.ClientErrorAttributes, "multiple-document-handling"
     127
     128def Copies(val):
     129    """4.2.5 copies (integer(1:MAX))
     130
     131    """
     132   
     133    raise errors.ClientErrorAttributes, "copies"
     134
     135def Finishings(*vals):
     136    """4.2.6 finishings (1setOf type2 enum)
     137
     138    """
     139
     140    raise errors.ClientErrorAttributes, "finishings"
     141
     142def PageRanges(*vals):
     143    """4.2.7 page-ranges (1setOf rangeOfInteger (1:MAX))
     144
     145    """
     146
     147    raise errors.ClientErrorAttributes, "page-ranges"
     148
     149def Sides(val):
     150    """4.2.8 sides (type2 keyword)
     151
     152    """
     153
     154    raise errors.ClientErrorAttributes, "sides"
     155
     156def NumberUp(val):
     157    """4.2.9 number-up (integer(1:MAX))
     158
     159    """
     160
     161    raise errors.ClientErrorAttributes, "number-up"
     162
     163def OrientationRequested(val):
     164    """4.2.10 orientation-requested (type2 enum)
     165
     166    """
     167
     168    raise errors.ClientErrorAttributes, "orientation-requested"
     169
     170def Media(val):
     171    """4.2.11 media (type3 keyword | name(MAX))
     172
     173    """
     174
     175    raise errors.ClientErrorAttributes, "media"
     176
     177### XXX: we may want to repurpose this for bitrate?
     178def PrinterResolution(val):
     179    """4.2.12 printer-resolution (resolution)
     180
     181    """
     182
     183    raise errors.ClientErrorAttributes, "printer-resolution"
     184
     185def PrintQuality(val):
     186    """4.2.13 print-quality (type2 enum)
     187
     188    """
     189
     190    raise errors.ClientErrorAttributes, "print-quality"
    38191
    39192def JobUri(val):
     
    112265    """
    113266
    114     raise ClientErrorAttributes, "job-more-info"
     267    raise errors.ClientErrorAttributes, "job-more-info"
    115268
    116269def JobName(val):
     
    214367    """
    215368
    216     raise ClientErrorAttributes, "job-state-message"
     369    raise errors.ClientErrorAttributes, "job-state-message"
    217370
    218371def JobDetailedStatusMessages(val):
     
    221374    """
    222375
    223     raise ClientErrorAttributes, "job-detailed-status-messages"
     376    raise errors.ClientErrorAttributes, "job-detailed-status-messages"
    224377
    225378def JobDocumentAccessErrors(val):
     
    228381    """
    229382
    230     raise ClientErrorAttributes, "job-document-access-errors"
     383    raise errors.ClientErrorAttributes, "job-document-access-errors"
    231384
    232385def NumberOfDocuments(val):
     
    235388    """
    236389
    237     raise ClientErrorAttributes, "number-of-documents"
     390    raise errors.ClientErrorAttributes, "number-of-documents"
    238391
    239392def OutputDeviceAssigned(val):
     
    242395    """
    243396
    244     raise ClientErrorAttributes, "output-device-assigned"
     397    raise errors.ClientErrorAttributes, "output-device-assigned"
    245398
    246399def TimeAtCreation(val):
     
    315468    """
    316469
    317     raise ClientErrorAttributes, "date-time-at-creation"
     470    raise errors.ClientErrorAttributes, "date-time-at-creation"
    318471
    319472def DateTimeAtProcessing(val):
     
    322475    """
    323476
    324     raise ClientErrorAttributes, "date-time-at-processing"
     477    raise errors.ClientErrorAttributes, "date-time-at-processing"
    325478
    326479def DateTimeAtCompletion(val):
     
    329482    """
    330483
    331     raise ClientErrorAttributes, "date-time-at-completion"
     484    raise errors.ClientErrorAttributes, "date-time-at-completion"
    332485
    333486def NumberOfInterveningJobs(val):
     
    336489    """
    337490
    338     raise ClientErrorAttributes, "number-of-intervening-jobs"
     491    raise errors.ClientErrorAttributes, "number-of-intervening-jobs"
    339492
    340493def JobMessageFromOperator(val):
     
    343496    """
    344497
    345     raise ClientErrorAttributes, "job-message-from-operator"
     498    raise errors.ClientErrorAttributes, "job-message-from-operator"
    346499
    347500def JobKOctets(val):
     
    379532    """
    380533
    381     raise ClientErrorAttributes, "job-impressions"
     534    raise errors.ClientErrorAttributes, "job-impressions"
    382535
    383536def JobMediaSheets(val):
     
    386539    """
    387540
    388     raise ClientErrorAttributes, "job-media-sheets"
     541    raise errors.ClientErrorAttributes, "job-media-sheets"
    389542
    390543def JobKOctetsProcessed(val):
     
    393546    """
    394547
    395     raise ClientErrorAttributes, "job-k-octets-processed"
     548    raise errors.ClientErrorAttributes, "job-k-octets-processed"
    396549
    397550def JobImpressionsCompleted(val):
     
    400553    """
    401554
    402     raise ClientErrorAttributes, "job-impressions-completed"
     555    raise errors.ClientErrorAttributes, "job-impressions-completed"
    403556
    404557def JobMediaSheetsCompleted(val):
     
    407560    """
    408561
    409     raise ClientErrorAttributes, "job-media-sheets-completed"
     562    raise errors.ClientErrorAttributes, "job-media-sheets-completed"
    410563
    411564def AttributesCharset(val):
Note: See TracChangeset for help on using the changeset viewer.