port to python3.x version 11/293311/1
authorbiao716.wang <biao716.wang@samsung.com>
Wed, 24 May 2023 09:16:46 +0000 (18:16 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Wed, 24 May 2023 09:16:46 +0000 (18:16 +0900)
Change-Id: I5833cdb12165947639b1167f85b4f93a264c396e
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
fixtures/py_scripts/repo_parse.py
settings.py

index d3a4ccb..d849672 100644 (file)
@@ -11,11 +11,11 @@ def get_slave_address():
     out = pipe.stdout.readlines()
     ip = str(out[0])
     ip = ip.replace("\n","")
-    print ip
+    print(ip)
     return ip
 
 for arg in sys.argv:
-    print arg
+    print(arg)
 
 #del line start with "repo" string from org file
 with open(sys.argv[1],"r") as file_r:
@@ -35,13 +35,13 @@ with open(sys.argv[1],"a") as file_w:
                 ip = get_slave_address()
                 #print ip,repo
                 repo = repo.replace("localhost",ip)
-                print repo
+                print(repo)
             file_w.write(repo + '\n')
 
 if sys.argv[3] == "common-with-local-tpk-profile":
     ip = get_slave_address()
     tpkurl="http://"+ip+':'+"8881"+"/repo/TPK/org.tizen.calendar-1.0.0-x86.tpk"
-    print tpkurl
+    print(tpkurl)
     pipe = subprocess.call('sudo mkdir -p /home/build/tmp/mic/tpk',shell=True)
     cmdln = ["sudo","wget","-P","/home/build/tmp/mic/tpk",tpkurl]
     pipe2 = subprocess.Popen(cmdln)
index 3bf825c..5d3ba2d 100644 (file)
@@ -5,7 +5,7 @@ import platform
 import subprocess
 
 from itest.utils import check_output
-
+from functools import reduce
 
 CWD = os.path.dirname(os.path.abspath(__file__))
 
@@ -23,7 +23,7 @@ def sample_files(path, k, predict=None):
                     yield path
 
     files = list(find_files(path))
-    idx = random.sample(range(0, len(files)), min(k, len(files)))
+    idx = random.sample(list(range(0, len(files))), min(k, len(files)))
     return [ files[i] for i in idx ]
 
 def is_bootstrap_file(case_path):