@@ -598,21 +598,33 @@ def compute_best_candidate(
598
598
applicable_candidates = self .get_applicable_candidates (candidates )
599
599
600
600
best_candidate = self .sort_best_candidate (applicable_candidates )
601
- if best_candidate .variant_hash is not None :
601
+ if best_candidate is not None and best_candidate .variant_hash is not None :
602
602
variants_json = VariantsJson (
603
603
self ._variants_json .get (
604
- f"{ best_candidate .name } -{ best_candidate .version } -variants.json"
604
+ f"{ best_candidate .name .replace ('-' , '_' )} -"
605
+ f"{ best_candidate .version } -variants.json"
605
606
).json ()
606
607
)
607
608
vdesc = variants_json .variants [best_candidate .variant_hash ]
608
- logger .info ("%(name)s %(version)s; selected variant: %(variant_hash)s" ,
609
- {
610
- "name" : best_candidate .name ,
611
- "version" : best_candidate .version ,
612
- "variant_hash" : best_candidate .variant_hash ,
613
- })
609
+
610
+ header_str = (
611
+ f"{ best_candidate .name } =={ best_candidate .version } ; "
612
+ f"variant_hash={ best_candidate .variant_hash } "
613
+ )
614
+ header_offset , right_extra = divmod ((80 - len (header_str ) - 2 ), 2 )
615
+
616
+ logger .info (
617
+ "%(left)s %(center)s %(right)s\n " ,
618
+ {
619
+ "left" : "#" * header_offset ,
620
+ "center" : header_str ,
621
+ "right" : "#" * (header_offset + right_extra ),
622
+ },
623
+ )
614
624
for vprop in vdesc .properties :
615
- logger .info (" %(vprop)s" , {"vprop" : vprop .to_str ()})
625
+ logger .info ("Variant-property: %(vprop)s" , {"vprop" : vprop .to_str ()})
626
+
627
+ logger .info ("%s\n " , "#" * 80 )
616
628
617
629
return BestCandidateResult (
618
630
candidates ,
0 commit comments