Changeset 793432f for server/lib/gutenbach/server/printer.py
- Timestamp:
- Dec 23, 2011, 9:37:39 PM (12 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/server/printer.py
raded2d1 r793432f 1 1 #import alsaaudio as aa 2 2 from .exceptions import InvalidJobException, InvalidPrinterStateException 3 from gutenbach.ipp.attribute import Attribute4 3 import gutenbach.ipp as ipp 5 import gutenbach.ipp.constants as const6 import gutenbach.ipp.object_attributes.printer_description_attributes as pda7 4 import logging 8 5 import time … … 89 86 @property 90 87 def printer_uri_supported(self): 91 return pda.PrinterUriSupported(self.uri)88 return ipp.PrinterUriSupported(self.uri) 92 89 93 90 @property 94 91 def uri_authentication_supported(self): 95 return pda.UriAuthenticationSupported("none")92 return ipp.UriAuthenticationSupported("none") 96 93 97 94 @property 98 95 def uri_security_supported(self): 99 return pda.UriSecuritySupported("none")96 return ipp.UriSecuritySupported("none") 100 97 101 98 @property 102 99 def printer_name(self): 103 return pda.PrinterName(self.name)100 return ipp.PrinterName(self.name) 104 101 105 102 @property 106 103 def printer_state(self): 107 return pda.PrinterState(ipp.constants.PrinterStates.IDLE)104 return ipp.PrinterState(ipp.constants.PrinterStates.IDLE) 108 105 109 106 @property 110 107 def printer_state_reasons(self): 111 return pda.PrinterStateReasons("none")108 return ipp.PrinterStateReasons("none") 112 109 113 110 @property 114 111 def ipp_versions_supported(self): 115 return pda.IppVersionsSupported("1.0", "1.1")112 return ipp.IppVersionsSupported("1.0", "1.1") 116 113 117 114 # XXX: We should query ourself for the supported operations 118 115 @property 119 116 def operations_supported(self): 120 return pda.OperationsSupported(ipp.Operations.GET_JOBS)117 return ipp.OperationsSupported(ipp.OperationCodes.GET_JOBS) 121 118 122 119 @property 123 120 def charset_configured(self): 124 return pda.CharsetConfigured("utf-8")121 return ipp.CharsetConfigured("utf-8") 125 122 126 123 @property 127 124 def charset_supported(self): 128 return pda.CharsetSupported("utf-8")125 return ipp.CharsetSupported("utf-8") 129 126 130 127 @property 131 128 def natural_language_configured(self): 132 return pda.NaturalLanguageConfigured("en-us")129 return ipp.NaturalLanguageConfigured("en-us") 133 130 134 131 @property 135 132 def generated_natural_language_supported(self): 136 return pda.GeneratedNaturalLanguageSupported("en-us")133 return ipp.GeneratedNaturalLanguageSupported("en-us") 137 134 138 135 @property 139 136 def document_format_default(self): 140 return pda.DocumentFormatDefault("application/octet-stream")137 return ipp.DocumentFormatDefault("application/octet-stream") 141 138 142 139 @property 143 140 def document_format_supported(self): 144 return pda.DocumentFormatSupported("application/octet-stream", "audio/mp3")141 return ipp.DocumentFormatSupported("application/octet-stream", "audio/mp3") 145 142 146 143 @property 147 144 def printer_is_accepting_jobs(self): 148 return pda.PrinterIsAcceptingJobs(True)145 return ipp.PrinterIsAcceptingJobs(True) 149 146 150 147 @property 151 148 def queued_job_count(self): 152 return pda.QueuedJobCount(len(self.active_jobs))149 return ipp.QueuedJobCount(len(self.active_jobs)) 153 150 154 151 @property 155 152 def pdl_override_supported(self): 156 return pda.PdlOverrideSupported("not-attempted")153 return ipp.PdlOverrideSupported("not-attempted") 157 154 158 155 @property 159 156 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) 161 158 162 159 @property 163 160 def compression_supported(self): 164 return pda.CompressionSupported("none")161 return ipp.CompressionSupported("none") 165 162 166 163 @property 167 164 def multiple_operation_time_out(self): 168 return pda.MultipleOperationTimeOut(240)165 return ipp.MultipleOperationTimeOut(240) 169 166 170 167 @property 171 168 def multiple_document_jobs_supported(self): 172 return pda.MultipleDocumentJobsSupported(False)169 return ipp.MultipleDocumentJobsSupported(False) 173 170 174 171 def get_printer_attributes(self, request):
Note: See TracChangeset
for help on using the changeset viewer.