Ensure RAT does not report marvin generated files as noncompliant in developer environment

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Chiradeep Vittal 2013-03-02 16:49:02 +05:30 committed by Prasanna Santhanam
parent e08281838a
commit 6a1ecae552
2 changed files with 29 additions and 22 deletions

View File

@ -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>

View File

@ -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)