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 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/server/printer.py

    raded2d1 r793432f  
    11#import alsaaudio as aa
    22from .exceptions import InvalidJobException, InvalidPrinterStateException
    3 from gutenbach.ipp.attribute import Attribute
    43import gutenbach.ipp as ipp
    5 import gutenbach.ipp.constants as const
    6 import gutenbach.ipp.object_attributes.printer_description_attributes as pda
    74import logging
    85import time
     
    8986    @property
    9087    def printer_uri_supported(self):
    91         return pda.PrinterUriSupported(self.uri)
     88        return ipp.PrinterUriSupported(self.uri)
    9289
    9390    @property
    9491    def uri_authentication_supported(self):
    95         return pda.UriAuthenticationSupported("none")
     92        return ipp.UriAuthenticationSupported("none")
    9693
    9794    @property
    9895    def uri_security_supported(self):
    99         return pda.UriSecuritySupported("none")
     96        return ipp.UriSecuritySupported("none")
    10097
    10198    @property
    10299    def printer_name(self):
    103         return pda.PrinterName(self.name)
     100        return ipp.PrinterName(self.name)
    104101
    105102    @property
    106103    def printer_state(self):
    107         return pda.PrinterState(ipp.constants.PrinterStates.IDLE)
     104        return ipp.PrinterState(ipp.constants.PrinterStates.IDLE)
    108105
    109106    @property
    110107    def printer_state_reasons(self):
    111         return pda.PrinterStateReasons("none")
     108        return ipp.PrinterStateReasons("none")
    112109
    113110    @property
    114111    def ipp_versions_supported(self):
    115         return pda.IppVersionsSupported("1.0", "1.1")
     112        return ipp.IppVersionsSupported("1.0", "1.1")
    116113
    117114    # XXX: We should query ourself for the supported operations
    118115    @property
    119116    def operations_supported(self):
    120         return pda.OperationsSupported(ipp.Operations.GET_JOBS)
     117        return ipp.OperationsSupported(ipp.OperationCodes.GET_JOBS)
    121118
    122119    @property
    123120    def charset_configured(self):
    124         return pda.CharsetConfigured("utf-8")
     121        return ipp.CharsetConfigured("utf-8")
    125122
    126123    @property
    127124    def charset_supported(self):
    128         return pda.CharsetSupported("utf-8")
     125        return ipp.CharsetSupported("utf-8")
    129126
    130127    @property
    131128    def natural_language_configured(self):
    132         return pda.NaturalLanguageConfigured("en-us")
     129        return ipp.NaturalLanguageConfigured("en-us")
    133130
    134131    @property
    135132    def generated_natural_language_supported(self):
    136         return pda.GeneratedNaturalLanguageSupported("en-us")
     133        return ipp.GeneratedNaturalLanguageSupported("en-us")
    137134
    138135    @property
    139136    def document_format_default(self):
    140         return pda.DocumentFormatDefault("application/octet-stream")
     137        return ipp.DocumentFormatDefault("application/octet-stream")
    141138
    142139    @property
    143140    def document_format_supported(self):
    144         return pda.DocumentFormatSupported("application/octet-stream", "audio/mp3")
     141        return ipp.DocumentFormatSupported("application/octet-stream", "audio/mp3")
    145142
    146143    @property
    147144    def printer_is_accepting_jobs(self):
    148         return pda.PrinterIsAcceptingJobs(True)
     145        return ipp.PrinterIsAcceptingJobs(True)
    149146
    150147    @property
    151148    def queued_job_count(self):
    152         return pda.QueuedJobCount(len(self.active_jobs))
     149        return ipp.QueuedJobCount(len(self.active_jobs))
    153150
    154151    @property
    155152    def pdl_override_supported(self):
    156         return pda.PdlOverrideSupported("not-attempted")
     153        return ipp.PdlOverrideSupported("not-attempted")
    157154
    158155    @property
    159156    def printer_up_time(self):
    160         return pda.PrinterUpTime(int(time.time()) - self.time_created)
     157        return ipp.PrinterUpTime(int(time.time()) - self.time_created)
    161158
    162159    @property
    163160    def compression_supported(self):
    164         return pda.CompressionSupported("none")
     161        return ipp.CompressionSupported("none")
    165162
    166163    @property
    167164    def multiple_operation_time_out(self):
    168         return pda.MultipleOperationTimeOut(240)
     165        return ipp.MultipleOperationTimeOut(240)
    169166
    170167    @property
    171168    def multiple_document_jobs_supported(self):
    172         return pda.MultipleDocumentJobsSupported(False)
     169        return ipp.MultipleDocumentJobsSupported(False)
    173170
    174171    def get_printer_attributes(self, request):
Note: See TracChangeset for help on using the changeset viewer.