Skip to content

Commit 7499cde

Browse files
committed
move constants to the top
1 parent cff2b19 commit 7499cde

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

process_executable_file.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@
1616
from string import Template
1717
from 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

2029
def 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-
3034
def 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-
5451
def is_arm() -> bool:
5552
return platform.machine().lower() in ('arm', 'arm64', 'aarch64')
5653

0 commit comments

Comments
 (0)