You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/03/05 02:33:15 UTC
[5/25] git commit: refs/heads/vim51_win8 - Ensure RAT does not report
marvin generated files as noncompliant in developer environment
Ensure RAT does not report marvin generated files as noncompliant in developer environment
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
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/vim51_win8
Commit: 6a1ecae552e8857c8e97c283962d14db4479a9a1
Parents: e082818
Author: Chiradeep Vittal <ch...@gmail.com>
Authored: Sat Mar 2 16:49:02 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
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 @@
<exclude>tools/appliance/definitions/systemvmtemplate/definition.rb</exclude>
<exclude>tools/appliance/definitions/systemvmtemplate/preseed.cfg</exclude>
<exclude>tools/appliance/definitions/systemvmtemplate/zerodisk.sh</exclude>
+ <exclude>tools/cli/cloudmonkey.egg-info/*</exclude>
<exclude>tools/devcloud/src/deps/boxes/basebox-build/definition.rb</exclude>
<exclude>tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg</exclude>
+ <exclude>tools/marvin/Marvin.egg-info/*</exclude>
<exclude>ui/lib/flot/jquery.colorhelpers.js</exclude>
<exclude>ui/lib/flot/jquery.flot.crosshair.js</exclude>
<exclude>ui/lib/flot/jquery.flot.fillbetween.js</exclude>
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)