@@ -30,6 +30,8 @@ import pyard.mappings
3030from pyard import db , data_repository
3131from pyard .misc import get_data_dir
3232
33+ LONG_DASH_LINE_LENGTH = 45
34+
3335
3436def get_latest_imgt_version () -> int :
3537 """
@@ -70,7 +72,7 @@ if __name__ == "__main__":
7072 db_connection , db_filename = db .create_db_connection (
7173 data_dir , imgt_version , ro = True
7274 )
73- print ("- " * 43 )
75+ print ("= " * LONG_DASH_LINE_LENGTH )
7476 if imgt_version == "Latest" :
7577 db_version = data_repository .get_db_version (db_connection )
7678 print (f"IMGT DB Version: { imgt_version } ({ db_version } )" )
@@ -90,19 +92,20 @@ if __name__ == "__main__":
9092 file_size = get_file_size (db_filename )
9193 print (f"File: { db_filename } " )
9294 print (f"Size: { file_size :.2f} MB" )
93- print ("-" * 43 )
94- print (f"|{ 'Table Name' :20 } |{ 'Rows' :20 } |" )
95- print (f"|{ '-' * 41 } |" )
96- for table in (
95+ print ("-" * LONG_DASH_LINE_LENGTH )
96+ print (f"|{ 'Table Name' :30 } |{ 'Rows' :>12 } |" )
97+ print (f"|{ '-' * ( LONG_DASH_LINE_LENGTH - 2 ) } |" )
98+ for table in sorted (
9799 pyard .mappings .ars_mapping_tables
98100 + pyard .mappings .code_mapping_tables
99101 + pyard .mappings .allele_tables
100- + ["mac_codes" ]
102+ + pyard .mappings .serology_tables
103+ + pyard .mappings .misc_tables
101104 ):
102105 if db .table_exists (db_connection , table ):
103106 total_rows = db .count_rows (db_connection , table )
104- print (f"|{ table :20 } |{ total_rows :20 } |" )
107+ print (f"|{ table :30 } |{ int ( total_rows ):12,d } |" )
105108 else :
106109 print (f"MISSING: { table } table" )
107- print ("-" * 43 )
110+ print ("-" * LONG_DASH_LINE_LENGTH )
108111 db_connection .close ()
0 commit comments