X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=bin%2FsearchFreePort.py;h=85eee9bbb74918f6e87f387c107ab4b80ad18629;hb=2dd308e0979e7af5e505bb076772161eae76b9a4;hp=cdf304eba8e60a085a5c649bb443b24c57df2fcc;hpb=0dda5bf24dc8c1a57fc668a98576de03a0087d8b;p=modules%2Fkernel.git diff --git a/bin/searchFreePort.py b/bin/searchFreePort.py index cdf304eba..85eee9bbb 100755 --- a/bin/searchFreePort.py +++ b/bin/searchFreePort.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # @@ -69,27 +69,27 @@ def searchFreePort_withPortManager(queue, args={}, save_config=1, use_port=None) port = getPort(use_port) if use_port: - print "Check if port can be used: %d" % use_port, + print("Check if port can be used: %d" % use_port, end=' ') if port == use_port and port != -1: - print "- OK" + print("- OK") __setup_config(use_port, args, save_config) queue.put([os.environ['OMNIORB_CONFIG'], os.environ['NSPORT'], os.environ['NSHOST']]) return else: - print "- KO: port is busy" + print("- KO: port is busy") pass # - print "Searching for a free port for naming service:", + print("Searching for a free port for naming service:", end=' ') if port == -1: # try again port = getPort(use_port) if port != -1: - print "%s - OK"%(port) + print("%s - OK"%(port)) __setup_config(port, args, save_config) else: - print "Unable to obtain port" + print("Unable to obtain port") queue.put([os.environ['OMNIORB_CONFIG'], os.environ['NSPORT'], @@ -99,7 +99,7 @@ def searchFreePort_withPortManager(queue, args={}, save_config=1, use_port=None) def __savePortToFile(args): # Save Naming service port name into # the file args["ns_port_log_file"] - if args.has_key('ns_port_log_file'): + if 'ns_port_log_file' in args: omniorbUserPath = os.getenv("OMNIORB_USER_PATH") file_name = os.path.join(omniorbUserPath, args["ns_port_log_file"]) with open(file_name, "w") as f: