Add --tizen3 argument to tsp/scripts/publish.py 37/108737/3
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 16 Nov 2016 13:48:52 +0000 (14:48 +0100)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Mon, 16 Jan 2017 10:07:49 +0000 (11:07 +0100)
Change-Id: I7b2c8d9d10efcd82022f04d36b63619ac29ee99b
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tsp/scripts/publish.py

index a08ec0e..89c2efb 100755 (executable)
@@ -65,7 +65,7 @@ def print_row(row, color):
     print template.render(build_nr=build_nr, sr=sr, row=[date, build_nr, target],\
             status=status, target=target, color=color, screenshotable=SCREENSHOTABLE)
 
-def print_view(dbpath):
+def print_view(dbpath, tizen3):
     def next_color(col):
         return COLORS[(COLORS.index(col) + 1) % len(COLORS)]
     conn = sqlite3.connect(dbpath)
@@ -76,6 +76,8 @@ def print_view(dbpath):
     prev_sr = ''
     for row in testresults:
         sr=row[0]
+        if tizen3 and not '-3.0-' in sr:
+            continue
         if not sr == prev_sr:
             prev_sr = sr
             col = next_color(col)
@@ -88,6 +90,10 @@ def parse_arguments():
     parser.add_argument("db3", metavar='<db>', type=str,
             help='database path')
 
+    parser.add_argument("-3", "--tizen3",
+            action="store_true", dest="tizen3",
+            help='Print results for Tizen 3.0 only')
+
     args = parser.parse_args()
 
     return args
@@ -95,7 +101,7 @@ def parse_arguments():
 def main():
     args = parse_arguments()
     if args.db3:
-        print_view(args.db3)
+        print_view(args.db3, args.tizen3)
 
 if __name__ == '__main__':
     main()