import os import hashlib import subprocess from path import convert_to_native def uncompress_file_to_dir(compressed_file, uncompress_dir): os.makedirs(uncompress_dir, exist_ok=True) if subprocess.call([ 'msiexec', '/a', convert_to_native(compressed_file).replace('/', '\\'), '/quiet', 'TARGETDIR=' + convert_to_native(uncompress_dir).replace('/', '\\')]) != 0: raise Exception('msiexec failed') return uncompress_dir BUF_SIZE = 1048576 def get_hash(file_path): sha512 = hashlib.sha512() with open(file_path, 'rb') as f: while data := f.read(BUF_SIZE): sha512.update(data) return sha512.hexdigest() def get_file_info(mar_file, url): filesize = os.path.getsize(mar_file) data = {'hash': get_hash(mar_file), 'hash_function': 'sha512', 'size': filesize, 'url': url + os.path.basename(mar_file)} return data def make_complete_mar_name(target_dir, filename_prefix): filename = filename_prefix + "_complete.mar" return os.path.join(target_dir, filename) ro/collabora/cd-5.3-3.4 LibreOffice 界面翻译代码仓库文档基金会
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2016-08-24 20:49:05 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2016-08-24 21:15:30 +0200
commit75ff2af971a9c8cd1ebc00dcbd4723f05c82a358 (patch)
tree0691fd27266c109ef39ca67c14fbf1a4a78b4beb
parent3682d899bc90511f39fc3d8092273c7ca953afd1 (diff)
update translations for 5.2.1 rc2 libreoffice-5-2-1
and force-fix errors using pocheck Change-Id: I596fa1e8acc5be5e9ef1867b378b291a6853d935 (cherry picked from commit cc220e305045212ebb6311476ff3999d88fa6def) (cherry picked from commit 42510aa08ecb272537241e7d4afaf6539c5c97b0)
Diffstat