Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A28EDD6A3 for ; Mon, 4 Mar 2013 13:43:06 +0000 (UTC) Received: (qmail 84442 invoked by uid 500); 4 Mar 2013 13:43:05 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 84373 invoked by uid 500); 4 Mar 2013 13:43:05 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 82629 invoked by uid 99); 4 Mar 2013 13:43:01 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Mar 2013 13:43:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B43BF31454B; Mon, 4 Mar 2013 13:43:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tsp@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [33/44] git commit: refs/heads/marvin-refactor - Ensure RAT does not report marvin generated files as noncompliant in developer environment Message-Id: <20130304134300.B43BF31454B@tyr.zones.apache.org> Date: Mon, 4 Mar 2013 13:43:00 +0000 (UTC) Ensure RAT does not report marvin generated files as noncompliant in developer environment Signed-off-by: Prasanna Santhanam Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6a1ecae5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6a1ecae5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6a1ecae5 Branch: refs/heads/marvin-refactor Commit: 6a1ecae552e8857c8e97c283962d14db4479a9a1 Parents: e082818 Author: Chiradeep Vittal Authored: Sat Mar 2 16:49:02 2013 +0530 Committer: Prasanna Santhanam Committed: Sat Mar 2 16:49:02 2013 +0530 ---------------------------------------------------------------------- pom.xml | 2 + tools/marvin/marvin/codegenerator.py | 49 ++++++++++++++++------------- 2 files changed, 29 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6a1ecae5/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index dde205f..3219ab0 100644 --- a/pom.xml +++ b/pom.xml @@ -382,8 +382,10 @@ tools/appliance/definitions/systemvmtemplate/definition.rb tools/appliance/definitions/systemvmtemplate/preseed.cfg tools/appliance/definitions/systemvmtemplate/zerodisk.sh + tools/cli/cloudmonkey.egg-info/* tools/devcloud/src/deps/boxes/basebox-build/definition.rb tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg + tools/marvin/Marvin.egg-info/* ui/lib/flot/jquery.colorhelpers.js ui/lib/flot/jquery.flot.crosshair.js ui/lib/flot/jquery.flot.fillbetween.js http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6a1ecae5/tools/marvin/marvin/codegenerator.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/codegenerator.py b/tools/marvin/marvin/codegenerator.py index cce9100..ed9248c 100644 --- a/tools/marvin/marvin/codegenerator.py +++ b/tools/marvin/marvin/codegenerator.py @@ -48,6 +48,26 @@ class codeGenerator: self.subclass = [] self.outputFolder = outputFolder self.apiSpecFile = apiSpecFile + lic = """\ + # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. + + """ + self.license = dedent(lic) def addAttribute(self, attr, pro): value = pro.value @@ -81,25 +101,7 @@ class codeGenerator: self.cmd = cmd self.cmdsName.append(self.cmd.name) - license = """\ - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - """ - self.code = dedent(license) + self.code = self.license self.code += "\n" self.code += '"""%s"""\n'%self.cmd.desc self.code += 'from baseCmd import *\n' @@ -186,25 +188,28 @@ class codeGenerator: initCmdsList += '"%s",'%cmdName fp = open(self.outputFolder + '/cloudstackAPI/cloudstackAPIClient.py', 'w') + fp.write(self.license) for item in [header, imports, body]: fp.write(item) fp.close() '''generate __init__.py''' - initCmdsList += '"cloudstackAPIClient"]' + initCmdsList = self.license + initCmdsList + '"cloudstackAPIClient"]' fp = open(self.outputFolder + '/cloudstackAPI/__init__.py', 'w') fp.write(initCmdsList) fp.close() fp = open(self.outputFolder + '/cloudstackAPI/baseCmd.py', 'w') - basecmd = '"""Base Command"""\n' + basecmd = self.license + basecmd += '"""Base Command"""\n' basecmd += 'class baseCmd:\n' basecmd += self.space + 'pass\n' fp.write(basecmd) fp.close() fp = open(self.outputFolder + '/cloudstackAPI/baseResponse.py', 'w') - basecmd = '"""Base class for response"""\n' + basecmd = self.license + basecmd += '"""Base class for response"""\n' basecmd += 'class baseResponse:\n' basecmd += self.space + 'pass\n' fp.write(basecmd)