Fix a bug in the *.spec files and also apply the following major changes:
- Add support for adding the base folder to PATH. - Only display one pop up window at a time in order to avoid confusion. - Add automatic updates feature: - Windows and Linux versions will be shipped with an updater program used to update both Artemis and the updater itself. - MacOs versions will not have the updater. Instead the user will be asked to download the new software version (if present) via browser.
This commit is contained in:
31
spec_files/__get_hash_code.py
Normal file
31
spec_files/__get_hash_code.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import hashlib
|
||||
import sys
|
||||
|
||||
|
||||
"""Print on stadard output the size in KB and sha256 codes of a list
|
||||
of command line-provided file names."""
|
||||
|
||||
print()
|
||||
|
||||
try:
|
||||
fnames = sys.argv[1:]
|
||||
except Exception:
|
||||
print("Provide a valid filename.")
|
||||
exit()
|
||||
|
||||
for fname in fnames:
|
||||
try:
|
||||
with open(fname, mode='rb') as f:
|
||||
target = f.read()
|
||||
except Exception:
|
||||
print("File not found")
|
||||
exit()
|
||||
|
||||
code = hashlib.sha256()
|
||||
code.update(target)
|
||||
hash_code = code.hexdigest()
|
||||
|
||||
print("File name:", fname)
|
||||
print("Size (KB):", round(len(target) / 1024, 3))
|
||||
print("Hash code:", hash_code)
|
||||
print("-" * 80)
|
||||
Reference in New Issue
Block a user