#!/usr/bin/env python3 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. #
# Extract a mar file and uncompress the content
import os import re import sys import subprocess from path import convert_to_native
def extract_mar(mar_file, target_dir):
mar = os.environ.get('MAR', 'mar')
subprocess.check_call([mar, "-C", convert_to_native(target_dir), "-x", convert_to_native(mar_file)])
file_info = subprocess.check_output([mar, "-t", convert_to_native(mar_file)])
lines = file_info.splitlines()
prog = re.compile(r"\d+\s+\d+\s+(.+)") for line in lines:
match = prog.match(line.decode("utf-8", "strict")) if match isNone: continue
info = match.groups()[0] # ignore header line if info == b'NAME': continue
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.