Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/adblockplus/files/mimeo.py

Issue 29586667: Make mimeo module only listen to localhost (Closed)
Patch Set: Created Oct. 23, 2017, 3:41 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 2
3 import argparse 3 import argparse
4 import re 4 import re
5 import sys 5 import sys
6 import threading 6 import threading
7 import traceback 7 import traceback
8 8
9 from http.server import BaseHTTPRequestHandler, HTTPServer 9 from http.server import BaseHTTPRequestHandler, HTTPServer
10 from string import Template 10 from string import Template
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 help='The file where the logs will be written') 77 help='The file where the logs will be written')
78 args = parser.parse_args() 78 args = parser.parse_args()
79 if args.output and args.output != '-': 79 if args.output and args.output != '-':
80 fh = open(args.output, 'a') 80 fh = open(args.output, 'a')
81 else: 81 else:
82 fh = open(sys.stdout.fileno(), 'w', closefd=False) 82 fh = open(sys.stdout.fileno(), 'w', closefd=False)
83 try: 83 try:
84 Handler.output = fh 84 Handler.output = fh
85 Handler.format = args.format 85 Handler.format = args.format
86 Handler.response = args.response 86 Handler.response = args.response
87 server_address = ('', args.port) 87 server_address = ('127.0.0.1', args.port)
88 httpd = HTTPServer(server_address, Handler) 88 httpd = HTTPServer(server_address, Handler)
89 httpd.serve_forever() 89 httpd.serve_forever()
90 finally: 90 finally:
91 fh.close() 91 fh.close()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld