1 #!/usr/bin/env monkeyrunner 2 # Copyright 2010, The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 import com.android.monkeyrunner.MonkeyRunnerHelp as mrh 16 import pydoc 17 import sys 18 19 def create_page(title, document): 20 return """ 21 page.title=%s 22 @jd:body 23 %s 24 </body> 25 </html> 26 """ % (title, document) 27 28 BASEDIR = 'frameworks/base/docs/html/guide/topics/testing/' 29 30 def main(): 31 document = "" 32 33 for clz in mrh.getAllDocumentedClasses(): 34 object, name = pydoc.resolve(str(clz), 0) 35 document += pydoc.html.document(object, name) 36 37 page = create_page('MonkeyRunner API', document) 38 file = open(BASEDIR + 'monkeyrunner_api.html', 'w') 39 file.write(page) 40 file.close() 41 42 if __name__ == '__main__': 43 main() 44