Fix the print syntax inconsistency between python2 and python3
Using the automation tool & manual check to fix the print syntax. Task: 24595 Story: 2003426 Change-Id: I3844c9644aabeeeb27bc2abb106c839b9921fe78
This commit is contained in:
parent
c3d9e4e689
commit
482d1acea8
|
@ -6,7 +6,7 @@ Copyright (c) 2018 Wind River Systems, Inc.
|
||||||
SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
from __future__ import print_function
|
||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
@ -15,8 +15,8 @@ import sys
|
||||||
import xml.etree.ElementTree as ElementTree
|
import xml.etree.ElementTree as ElementTree
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print "Usage: %s --groups <groups.xml> --pkgdir <pkgdir>" \
|
print("Usage: %s --groups <groups.xml> --pkgdir <pkgdir>" \
|
||||||
% os.path.basename(sys.argv[0])
|
% os.path.basename(sys.argv[0]))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
def add_text_tag_to_xml(parent,
|
def add_text_tag_to_xml(parent,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
from __future__ import print_function
|
||||||
import socket
|
import socket
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ UDP_IP = socket.gethostbyname('controller')
|
||||||
UDP_PORT = 2188
|
UDP_PORT = 2188
|
||||||
ENV_MESSAGE = os.environ["MESSAGE"]
|
ENV_MESSAGE = os.environ["MESSAGE"]
|
||||||
|
|
||||||
print "UDP target IP:", UDP_IP
|
print ("UDP target IP:", UDP_IP)
|
||||||
print "UDP target port:", UDP_PORT
|
print ("UDP target port:", UDP_PORT)
|
||||||
print "message:", ENV_MESSAGE
|
print ("message:", ENV_MESSAGE)
|
||||||
|
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
sock.sendto(ENV_MESSAGE, (UDP_IP, UDP_PORT))
|
sock.sendto(ENV_MESSAGE, (UDP_IP, UDP_PORT))
|
||||||
|
|
Loading…
Reference in New Issue