Changeset 7f1098c
- Timestamp:
- Jan 21, 2012, 6:24:36 PM (12 years ago)
- Branches:
- no-cups
- Children:
- 6c60b2e
- Parents:
- 279640c (diff), bd5bffc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Daniel Cooper <danny@…> (01/21/12 18:24:36)
- git-committer:
- Daniel Cooper <danny@…> (01/21/12 18:24:36)
- Location:
- server
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/TODO
rf0807b8 r1b6dc13 16 16 17 17 - add support in printer.py for: 18 [ 19 [ 18 [x] print job 19 [x] validate job 20 20 [x] pause printer 21 21 [x] resume printer … … 30 30 [x] resume job 31 31 32 - finish test cases for printer.py 33 - write test cases for requests.py 34 - write convenience client-side API 35 - write test cases for future client API 36 - all the documentation 37 - deal with all the code marked 'XXX' 38 - setuptools entry points for notification system (e.g. zephyr) 39 - check test case coverage ( http://nedbatchelder.com/code/coverage/ ) 40 - deal with queue management/reordering 41 - add support for volume management 42 - make sure all CUPS commands are compatible 43 - rewrite gbr/gbq/etc. scripts to use client API 44 - rewrite server-side queue display to use API 45 - support authentication/security 46 - why doesn't the bug tracker work?! relatedly, figure out a 47 solution that makes it easier for non-MIT developers to contribute 32 - server stuff 33 [ ] write convenience client-side API 34 [ ] setuptools entry points for notification system (e.g. zephyr) 35 [ ] deal with queue management/reordering 36 [ ] add support for volume management 37 [ ] support authentication/security 38 39 - client-ish stuff 40 [ ] rewrite gbr/gbq/etc. scripts to use client API 41 [ ] rewrite server-side queue display to use API 42 43 - misc 44 [ ] make sure all CUPS commands are compatible 45 [ ] deal with all the code marked 'XXX' 46 47 - documentation and testing 48 [ ] finish test cases for printer.py 49 [ ] write test cases for requests.py 50 [ ] write test cases for future client API 51 [ ] all the documentation 52 [ ] check test case coverage ( http://nedbatchelder.com/code/coverage/ ) 53 [ ] why doesn't the bug tracker work?! relatedly, figure out a 54 solution that makes it easier for non-MIT developers to contribute 48 55 49 56 Ponies -
server/lib/gutenbach-config
ra9eb577e rab7c1dd 1 1 port: 8000 2 2 loglevel: debug 3 logfile: gutenbach.log3 #logfile: gutenbach.log 4 4 5 5 printers: -
server/lib/gutenbach/server/job.py
r57bc2dc rbd5bffc 56 56 def __del__(self): 57 57 if self.player: 58 self.player.mplayer_stop() 58 if self.player.is_playing: 59 self.player.mplayer_stop() 60 if self.player.fh: 61 if self.player.fh.closed: 62 self.player.fh.close() 59 63 self.player = None 60 if self.document and not self.document.closed: 61 self.document.close() 62 self.document = None 63 64 65 self.document = None 64 66 self.id = None 65 67 self.creator = None -
server/lib/gutenbach/server/player.py
rcf0d7e8 rbd5bffc 28 28 def is_playing(self): 29 29 if self._dryrun: 30 return self.isAlive() and not self.is_done 30 return self.ident is not None and \ 31 self.isAlive() and \ 32 not self.is_done 31 33 else: 32 return self.isAlive() and \ 33 not self.is_done and \ 34 self.player is not None and \ 35 self.player.poll() is None 36 34 return self.ident is not None and \ 35 self.isAlive() and \ 36 not self.is_done and \ 37 self.player is not None and \ 38 self.player.poll() is None 39 37 40 @property 38 41 @sync … … 121 124 logger.warning("trying to pause non-playing job") 122 125 time.sleep(self._lag) 123 126 124 127 def mplayer_stop(self): 125 # Note: Inner Lock due to join.128 # Note: Inner lock due to join. 126 129 with self.lock: 127 130 if self.is_playing: … … 134 137 logger.warning("trying to stop non-playing job") 135 138 self.join() 139 -
server/test/server/job.py
radf8cf0 rbd5bffc 6 6 import sys 7 7 import time 8 import logging 8 9 9 10 def make_tempfile(): … … 204 205 205 206 if __name__ == "__main__": 207 logging.basicConfig(loglevel=logging.CRITICAL) 206 208 unittest.main() -
server/lib/gutenbach/server/requests.py
rc1dc25f rf70792f 169 169 170 170 """ 171 operation = request.attribute_groups[0] 172 # requested printer uri 173 if 'printer-uri' not in operation: 174 raise ipp.errors.ClientErrorBadRequest("Missing 'printer-uri' attribute") 175 printer_uri = verify_attribute(operation['printer-uri'], ipp.PrinterUri)[0] 176 if printer_uri not in self.printer.uris: 177 raise ipp.errors.ClientErrorAttributes( 178 str(operation['printer-uri']), operation['printer-uri']) 179 180 if 'requesting-user-name' in operation: 181 user_name = verify_attribute( 182 operation['requesting-user-name'], ipp.RequestingUserName)[0] 183 184 if 'job-name' in operation: 185 job_name = verify_attribute( 186 operation['job-name'], ipp.JobName)[0] 187 188 if 'job-k-octets' in operation: 189 job_k_octets = verify_attribute( 190 operation['job-k-octets'], ipp.JobKOctets)[0] 191 192 if 'ipp-attribute-fidelity' in operation: 193 pass # don't care 194 if 'job-impressions' in operation: 195 pass # don't care 196 if 'job-media-sheets' in operation: 197 pass # don't care 198 199 # get attributes from the printer and add to response 200 job_id = self.printer.create_job( 201 requesting_user_name=requesting_user_name, 202 job_name=job_name, 203 job_k_octets=job_k_octets) 204 attrs = self.printer.get_job_attributes(job_id) 205 response.attribute_groups.append(ipp.AttributeGroup( 206 ipp.AttributeTags.JOB, attrs)) 207 #raise ipp.errors.ServerErrorOperationNotSupported 208 # Get nescessary information for calling send_document 209 # Any field being set to None here just means that we either aren't using or haven't implemented parsing it 210 document = request.attribute_groups[2] 211 #XXX 212 document_format = None 213 document_natural_language = None 214 compression = None 215 last_document = None 216 217 171 218 172 raise ipp.errors.ServerErrorOperationNotSupported 173 219 # Actually put the document in the job 220 self.printer.send_document(job_id,document, 221 document_name = document_name, 222 document_format = document_format, 223 document_natural_language = document_natural_language, 224 requesting_user_name = requesting_user_name, 225 compression = compression, 226 last_document = last_document) 227 #fix this once jess pushes 228 self.print_job() 174 229 @handler_for(ipp.OperationCodes.VALIDATE_JOB) 175 230 def validate_job(self, request, response):
Note: See TracChangeset
for help on using the changeset viewer.