1414from . import progress
1515
1616
17- def doUploadFrogress (mapPath : Path , asmPath : Path , nonmatchingsPath : Path , project : str , version : str , category : str , baseurl : str , apikey : str | None = None , verbose : bool = False ) -> int :
18- totalStats , progressPerFolder = progress .getProgress (mapPath , asmPath , nonmatchingsPath )
19-
17+ def getFrogressEntriesFromStats (totalStats : progress_stats .ProgressStats , progressPerFolder : dict [str , progress_stats .ProgressStats ], verbose : bool = False ) -> dict [str , int ]:
2018 entries : dict [str , int ] = {}
2119 if verbose :
2220 progress_stats .ProgressStats .printHeader ()
@@ -32,9 +30,9 @@ def doUploadFrogress(mapPath: Path, asmPath: Path, nonmatchingsPath: Path, proje
3230
3331 if verbose :
3432 print ()
33+ return entries
3534
36- url = utils .generateFrogressEndpointUrl (baseurl , project , version )
37-
35+ def uploadEntriesToFrogress (entries : dict [str , int ], category : str , url : str , apikey : str | None = None , verbose : bool = False ):
3836 if verbose :
3937 print (f"Publishing entries to { url } " )
4038 for key , value in entries .items ():
@@ -51,10 +49,18 @@ def doUploadFrogress(mapPath: Path, asmPath: Path, nonmatchingsPath: Path, proje
5149 r .raise_for_status ()
5250 if verbose :
5351 print ("Done!" )
54-
5552 return 0
5653
5754
55+ def doUploadFrogress (mapPath : Path , asmPath : Path , nonmatchingsPath : Path , project : str , version : str , category : str , baseurl : str , apikey : str | None = None , verbose : bool = False ) -> int :
56+ totalStats , progressPerFolder = progress .getProgress (mapPath , asmPath , nonmatchingsPath )
57+
58+ entries : dict [str , int ] = getFrogressEntriesFromStats (totalStats , progressPerFolder , verbose )
59+
60+ url = utils .generateFrogressEndpointUrl (baseurl , project , version )
61+ return uploadEntriesToFrogress (entries , category , url , apikey = apikey , verbose = verbose )
62+
63+
5864def processArguments (args : argparse .Namespace ):
5965 mapPath : Path = args .mapfile
6066 asmPath : Path = args .asmpath
0 commit comments