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 | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/examples/flowbasic b/examples/flowbasic index c71debc9..edd96b0d 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 5c228ece..489898a2 100644 --- a/examples/har_extractor.py +++ b/examples/har_extractor.py @@ -231,4 +231,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)
\ No newline at end of file + print("%s.%s" % ('obj', attr), value, type(value)) diff --git a/examples/mitmproxywrapper.py b/examples/mitmproxywrapper.py index 2f3750e9..29e3ac16 100755 --- a/examples/mitmproxywrapper.py +++ b/examples/mitmproxywrapper.py @@ -28,12 +28,12 @@ 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') @@ -112,7 +112,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 481c0407..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)
\ No newline at end of file + print("start request: %s%s" % (flow.request.host, flow.request.path)) diff --git a/examples/read_dumpfile b/examples/read_dumpfile index f5818483..82bf832d 100644 --- a/examples/read_dumpfile +++ b/examples/read_dumpfile @@ -13,6 +13,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, v: - print "Flow file corrupted. Stopped loading." + print("Flow file corrupted. Stopped loading.") |