From patchwork Thu Jun 23 11:27:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 2201 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 279C823F7C for ; Thu, 23 Jun 2011 11:27:18 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id D8895A18569 for ; Thu, 23 Jun 2011 11:27:17 +0000 (UTC) Received: by qyk30 with SMTP id 30so1263652qyk.11 for ; Thu, 23 Jun 2011 04:27:17 -0700 (PDT) Received: by 10.229.40.139 with SMTP id k11mr1438836qce.135.1308828437068; Thu, 23 Jun 2011 04:27:17 -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.229.230.139 with SMTP id jm11cs15317qcb; Thu, 23 Jun 2011 04:27:16 -0700 (PDT) Received: by 10.216.157.2 with SMTP id n2mr3257264wek.2.1308828434467; Thu, 23 Jun 2011 04:27:14 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id f69si3537022wes.129.2011.06.23.04.27.14; Thu, 23 Jun 2011 04:27:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QZi41-0005mc-ND for ; Thu, 23 Jun 2011 11:27:13 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id AA89F2E890E for ; Thu, 23 Jun 2011 11:27:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard-tool X-Launchpad-Branch: ~linaro-validation/lava-dashboard-tool/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 149 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard-tool/trunk] Rev 149: Drop local copy of ExperimentalCommandMixIn Message-Id: <20110623112713.12434.23124.launchpad@loganberry.canonical.com> Date: Thu, 23 Jun 2011 11: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="13265"; Instance="initZopeless config overlay" X-Launchpad-Hash: 279f88f3bc9cf9f69b6d451ffb6e562956aabd96 ------------------------------------------------------------ revno: 149 committer: Zygmunt Krynicki branch nick: trunk timestamp: Thu 2011-06-23 13:24:34 +0200 message: Drop local copy of ExperimentalCommandMixIn modified: lava_dashboard_tool/commands.py --- lp:lava-dashboard-tool https://code.launchpad.net/~linaro-validation/lava-dashboard-tool/trunk You are subscribed to branch lp:lava-dashboard-tool. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard-tool/trunk/+edit-subscription === modified file 'lava_dashboard_tool/commands.py' --- lava_dashboard_tool/commands.py 2011-06-23 11:23:24 +0000 +++ lava_dashboard_tool/commands.py 2011-06-23 11:24:34 +0000 @@ -34,6 +34,7 @@ import xmlrpclib from lava_tool.interface import Command +from lava_tool.commands import ExperimentalCommandMixIn class InsufficientServerVersion(Exception): @@ -425,62 +426,6 @@ raise NotImplementedError() -class ExperimentalNoticeAction(argparse.Action): - """ - Argparse action that implements the --experimental-notice - """ - - message = """ - Some lc-tool sub-commands are marked as EXPERIMENTAL. Those commands are - not guaranteed to work identically, or have identical interface between - subsequent lc-tool releases. - - We do that to make it possible to provide good user interface and - server-side API when working on new features. Once a feature is stabilized - the UI will be frozen and all subsequent changes will retain backwards - compatibility. - """ - message = message.lstrip() - message = re.sub(re.compile("[ \t]+", re.M), " ", message) - message = re.sub(re.compile("^ ", re.M), "", message) - - def __init__(self, - option_strings, dest, default=None, required=False, - help=None): - super(ExperimentalNoticeAction, self).__init__( - option_strings=option_strings, dest=dest, default=default, nargs=0, - help=help) - - def __call__(self, parser, namespace, values, option_string=None): - parser.exit(message=self.message) - - -class ExperimentalCommandMixIn(object): - """ - Experimental command. - - Prints a warning message on each call to invoke() - """ - - def invoke(self): - self.print_experimental_notice() - return super(ExperimentalCommandMixIn, self).invoke() - - @classmethod - def register_arguments(cls, parser): - retval = super(ExperimentalCommandMixIn, cls).register_arguments(parser) - parser.register("action", "experimental_notice", ExperimentalNoticeAction) - group = parser.add_argument_group("experimental commands") - group.add_argument("--experimental-notice", - action="experimental_notice", - default=argparse.SUPPRESS, - help="Explain the nature of experimental commands") - return retval - - def print_experimental_notice(self): - print "EXPERIMENTAL - SUBJECT TO CHANGE (See --experimental-notice for more info)" - - class server_version(XMLRPCCommand): """ Display dashboard server version