diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/flowbasic | 2 | ||||
-rw-r--r-- | examples/har_extractor.py | 2 | ||||
-rwxr-xr-x | examples/mitmproxywrapper.py | 6 | ||||
-rw-r--r-- | examples/nonblocking.py | 4 | ||||
-rw-r--r-- | examples/read_dumpfile | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/examples/flowbasic b/examples/flowbasic index 083d7663..6663dc46 100755 --- a/examples/flowbasic +++ b/examples/flowbasic @@ -30,7 +30,7 @@ class MyMaster(flow.FlowMaster): f = flow.FlowMaster.handle_response(self, f) if f: f.reply() - print f + print(f) return f diff --git a/examples/har_extractor.py b/examples/har_extractor.py index 1a76fa1f..f06efec3 100644 --- a/examples/har_extractor.py +++ b/examples/har_extractor.py @@ -251,4 +251,4 @@ def print_attributes(obj, filter_string=None, hide_privates=False): if filter_string is not None and filter_string not in attr: continue value = getattr(obj, attr) - print "%s.%s" % ('obj', attr), value, type(value) + print("%s.%s" % ('obj', attr), value, type(value)) diff --git a/examples/mitmproxywrapper.py b/examples/mitmproxywrapper.py index 239642d7..7ea10715 100755 --- a/examples/mitmproxywrapper.py +++ b/examples/mitmproxywrapper.py @@ -32,14 +32,14 @@ class Wrapper(object): return dict([re.findall(r'([^:]+): (.*)', line)[0] for line in state]) def enable_proxy_for_service(self, service): - print 'Enabling proxy on {}...'.format(service) + print('Enabling proxy on {}...'.format(service)) for subcommand in ['-setwebproxy', '-setsecurewebproxy']: self.run_networksetup_command( subcommand, service, '127.0.0.1', str( self.port)) def disable_proxy_for_service(self, service): - print 'Disabling proxy on {}...'.format(service) + print('Disabling proxy on {}...'.format(service)) for subcommand in ['-setwebproxystate', '-setsecurewebproxystate']: self.run_networksetup_command(subcommand, service, 'Off') @@ -129,7 +129,7 @@ class Wrapper(object): @classmethod def ensure_superuser(cls): if os.getuid() != 0: - print 'Relaunching with sudo...' + print('Relaunching with sudo...') os.execv('/usr/bin/sudo', ['/usr/bin/sudo'] + sys.argv) @classmethod diff --git a/examples/nonblocking.py b/examples/nonblocking.py index f96b7f40..7bc9c07b 100644 --- a/examples/nonblocking.py +++ b/examples/nonblocking.py @@ -4,6 +4,6 @@ from libmproxy.script import concurrent @concurrent # Remove this and see what happens def request(context, flow): - print "handle request: %s%s" % (flow.request.host, flow.request.path) + print("handle request: %s%s" % (flow.request.host, flow.request.path)) time.sleep(5) - print "start request: %s%s" % (flow.request.host, flow.request.path) + print("start request: %s%s" % (flow.request.host, flow.request.path)) diff --git a/examples/read_dumpfile b/examples/read_dumpfile index 9da604cc..2238d2d2 100644 --- a/examples/read_dumpfile +++ b/examples/read_dumpfile @@ -14,6 +14,6 @@ with open("logfile", "rb") as logfile: print(f) print(f.request.host) json.dump(f.get_state(), sys.stdout, indent=4) - print "" + print("") except flow.FlowReadError as v: print "Flow file corrupted. Stopped loading." |