import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import sys
import subprocess
import string
-from optparse import OptionParser, make_option\r
-import ConfigParser
+from optparse import OptionParser, make_option
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir:
import sys
import subprocess
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-u", dest="buninstpkg", action="store_true", help="Uninstall package")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.device:
break
if not PARAMETERS.device:
- print "No device found"
+ print ("No device found")
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import subprocess
import string
from optparse import OptionParser, make_option
-import ConfigParser
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
userCheck()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import sys
import subprocess
import string
-from optparse import OptionParser, make_option\r
-import ConfigParser
+from optparse import OptionParser, make_option
+import configparser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = ConfigParser.ConfigParser()
+tct_parser = configparser.ConfigParser()
tct_parser.read(TCT_CONFIG_FILE)
SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
- print "-->> \"%s\"" % cmd
+ print ("-->> \"%s\"" % cmd)
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
if output_line == '' and cmd_return_code != None:
break
"-a", dest="user", action="store", help="User name")
global PARAMETERS
(PARAMETERS, args) = opts_parser.parse_args()
- except Exception, e:
- print "Got wrong option: %s, exit ..." % e
+ except Exception as e:
+ print ("Got wrong option: %s, exit ..." % e)
sys.exit(1)
if not PARAMETERS.user:
PARAMETERS.mode = "SSH"
if not PARAMETERS.device:
- print "No device provided"
+ print ("No device provided")
sys.exit(1)
user_info = getUSERID()
userid = user_info[1][0]
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
else:
- print "[Error] cmd commands error : %s"%str(user_info[1])
+ print ("[Error] cmd commands error : %s" % str(user_info[1]))
sys.exit(1)
if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
- print "-i and -u are conflict"
+ print ("-i and -u are conflict")
sys.exit(1)
if PARAMETERS.buninstpkg:
import zipfile
import signal
import subprocess
+import imp
from optparse import OptionParser
-reload(sys)
-sys.setdefaultencoding('utf8')
+imp.reload(sys)
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
while True:
- output_line = cmd_proc.stdout.readline().strip("\r\n")
+ output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
cmd_return_code = cmd_proc.poll()
elapsed_time = time.time() - pre_time
if cmd_return_code is None:
sys.exit(1)
if BUILD_PARAMETERS.bversion:
- print "Version: %s" % TOOL_VERSION
+ LOG.info("Version: %s" % TOOL_VERSION)
sys.exit(0)
if not BUILD_PARAMETERS.srcdir: