Changeset 318 for py-tcpmultiplexer
- Timestamp:
- Jul 19, 2011, 3:41:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
py-tcpmultiplexer/TCPMultiplexer.py
r317 r318 70 70 self.request.send("</ul><h3>Files</h3><ul>") 71 71 for root, dirs, files in os.walk(document_root): 72 # Please do not show any hidden files or directories 73 [dirs.remove(name) for name in dirs if name.startswith('.')] 74 [files.remove(name) for name in files if name.startswith('.')] 72 75 for name in files: 73 76 self.request.send('<li><a href="%(item)s">%(item)s</li>' % { 'item' : os.path.join(root.replace(document_root,'',1),name) }) 74 # Please do not show any hidden file75 [dirs.remove(name) for name in dirs if name.startswith('.')]76 77 self.request.send("</ul></body></html>") 77 78 elif urldata.has_key(urlid): … … 120 121 121 122 if datatype == 'wav': 123 # WAV header 122 124 dataheader[urlid] = f.read(44) 123 125 elif datatype == 'mjeg': 124 dataheader[urlid] = '\n'.join(f.read(100).split('\n')[0:2]) 126 # Get rid of Content-Length as not all pictures suits this setup 127 headers = f.read(100).splitlines()[0:3] 128 logger.info("Image headers %s", headers) 129 valid_image = headers[0] + f.read(100000).split(headers[0])[1] 130 dataheader[urlid] = valid_image + '\n'.join([h for h in headers if not h.startswith('Content-length:')]) + '\n' 125 131 else: 126 132 dataheader[urlid] = '' 133 134 logger.info("Using dataheader of length %s", len(dataheader[urlid])) 127 135 128 136 while running: … … 156 164 try: 157 165 import yaml 158 streams = yaml.load(open(args.stream_cfg))166 streams.update(yaml.load(open(args.stream_cfg))) 159 167 except (ImportError, IOError) as e: 160 168 logging.warning("Stream config file '%s' not readable or parsable (%s)", args.stream_cfg, e)
Note:
See TracChangeset
for help on using the changeset viewer.