1616from  string  import  Template 
1717from  typing  import  List , Tuple , Union 
1818
19+ _HASH_FILE_EXT  =  '.sha256' 
20+ _OS_TO_CLI_DIST_TEMPLATE  =  {
21+     'darwin' : Template ('cycode-mac$suffix$ext' ),
22+     'linux' : Template ('cycode-linux$suffix$ext' ),
23+     'windows' : Template ('cycode-win$suffix.exe$ext' ),
24+ }
25+ 
26+ DirHashes  =  List [Tuple [str , str ]]
27+ 
1928
2029def  get_hash_of_file (file_path : Union [str , Path ]) ->  str :
2130    with  open (file_path , 'rb' ) as  f :
2231        return  hashlib .sha256 (f .read ()).hexdigest ()
2332
2433
25- _HASH_FILE_EXT  =  '.sha256' 
26- 
27- DirHashes  =  List [Tuple [str , str ]]
28- 
29- 
3034def  calculate_hash_of_every_file_in_the_directory (dir_path : Path ) ->  DirHashes :
3135    hashes  =  []
3236
@@ -44,13 +48,6 @@ def calculate_hash_of_every_file_in_the_directory(dir_path: Path) -> DirHashes:
4448    return  hashes 
4549
4650
47- _OS_TO_CLI_DIST_TEMPLATE  =  {
48-     'darwin' : Template ('cycode-mac$suffix$ext' ),
49-     'linux' : Template ('cycode-linux$suffix$ext' ),
50-     'windows' : Template ('cycode-win$suffix.exe$ext' ),
51- }
52- 
53- 
5451def  is_arm () ->  bool :
5552    return  platform .machine ().lower () in  ('arm' , 'arm64' , 'aarch64' )
5653
0 commit comments