From patchwork Wed Aug 24 10:27:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Tunnicliffe X-Patchwork-Id: 3647 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 738C523F22 for ; Wed, 24 Aug 2011 10:27:16 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 30F13A18011 for ; Wed, 24 Aug 2011 10:27:16 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so1195599bkb.11 for ; Wed, 24 Aug 2011 03:27:15 -0700 (PDT) Received: by 10.204.133.215 with SMTP id g23mr2256071bkt.70.1314181635679; Wed, 24 Aug 2011 03:27:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.41.75 with SMTP id n11cs8581bke; Wed, 24 Aug 2011 03:27:14 -0700 (PDT) Received: by 10.227.12.18 with SMTP id v18mr1215486wbv.89.1314181634144; Wed, 24 Aug 2011 03:27:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com [91.189.90.7]) by mx.google.com with ESMTPS id ek2si2140199wbb.52.2011.08.24.03.27.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Aug 2011 03:27:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QwAfx-0002tj-Lo for ; Wed, 24 Aug 2011 10:27:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 9B15BE02C7 for ; Wed, 24 Aug 2011 10:27:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 423 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 423: Logs the output of linaro-media-create as run by linaro-fetch-image[-ui]. Message-Id: <20110824102713.5918.30964.launchpad@ackee.canonical.com> Date: Wed, 24 Aug 2011 10:27:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13727"; Instance="initZopeless config overlay" X-Launchpad-Hash: f6f69eb77a44ac56d478810d7bfcb32a3612bf36 Merge authors: James Tunnicliffe (dooferlad) Related merge proposals: https://code.launchpad.net/~dooferlad/linaro-image-tools/fetch_image_add_lmc_log/+merge/72462 proposed by: James Tunnicliffe (dooferlad) review: Approve - James Westby (james-w) ------------------------------------------------------------ revno: 423 [merge] committer: James Tunnicliffe branch nick: linaro-image-tools timestamp: Wed 2011-08-24 11:26:01 +0100 message: Logs the output of linaro-media-create as run by linaro-fetch-image[-ui]. modified: linaro_image_tools/fetch_image.py linaro_image_tools/fetch_image_settings.yaml --- lp:linaro-image-tools https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription === modified file 'linaro_image_tools/fetch_image.py' --- linaro_image_tools/fetch_image.py 2011-08-19 12:15:02 +0000 +++ linaro_image_tools/fetch_image.py 2011-08-22 17:04:07 +0000 @@ -36,6 +36,7 @@ import threading import subprocess import utils +import xdg.BaseDirectory as xdgBaseDir QEMU = "qemu" HARDWARE = "hardware" @@ -529,8 +530,7 @@ """Downloads files and creates images from them by calling linaro-media-create""" def __init__(self): - import xdg.BaseDirectory as xdgBaseDir - self.homedir = os.path.join(xdgBaseDir.xdg_config_home, + self.datadir = os.path.join(xdgBaseDir.xdg_data_home, "linaro", "image-tools", "fetch_image") @@ -611,6 +611,12 @@ args.append("--hwpack") args.append(hwpack_file) + if not os.path.isdir(self.datadir): + os.makedirs(self.datadir) + with open(os.path.join(self.datadir, "linaro-media-create.log"), + mode='w') as lmc_log: + lmc_log.write(" ".join(args) + "\n") + logging.info(" ".join(args)) return args @@ -656,6 +662,11 @@ self.settings = settings self.tools_dir = tools_dir + self.datadir = os.path.join(xdgBaseDir.xdg_data_home, + "linaro", + "image-tools", + "fetch_image") + def run(self): """ 1. Download required files. @@ -699,6 +710,9 @@ self.waiting_for_event_response = False self.event_queue.put(("start", "unpack")) + lmc_log = open(os.path.join(self.datadir, + "linaro-media-create.log"), mode='a') + while(1): if self.create_process.poll() != None: # linaro-media-create has finished. Tell the GUI the return @@ -722,6 +736,8 @@ if self.save_lines: self.saved_lines += self.line + lmc_log.write(self.line + "\n") + lmc_log.flush() self.line = "" else: self.line += self.input @@ -765,6 +781,8 @@ while self.waiting_for_event_response: time.sleep(0.2) + lmc_log.close() + def send_to_create_process(self, text): print >> self.create_process.stdin, text self.waiting_for_event_response = False === modified file 'linaro_image_tools/fetch_image_settings.yaml' --- linaro_image_tools/fetch_image_settings.yaml 2011-08-22 17:34:18 +0000 +++ linaro_image_tools/fetch_image_settings.yaml 2011-08-24 10:26:01 +0000 @@ -78,7 +78,6 @@ - imx51 mx53loco: - - lt-mx53loco - lt-mx5 u8500: