English 中文(简体)
Where is the help.py for Android s monkeyrunner
原标题:

I just can t find the help.py file in order to create the API reference for the monkeyrunner. The command described at the Android references

monkeyrunner <format> help.py <outfile> does not work when i call monkeyrunner html help.py /path/to/place/the/doc.html.

It s quite obvious that the help.py file is not found and the monkeyrunner also tells me "Can t open specified script file". But a locate on my system doesn t bring me a help.py file that has anything to do with monkeyrunner or Android.

So my question is: Where did they hide the help.py file for creating the API reference?

最佳回答

I cannot find it either. But one can assume that it is simply calling MonkeyRunner.help() with the passed in arguments. If you just want to get something quick use this script I created also named help.py:

#!/usr/bin/env python

# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice

text = MonkeyRunner.help("html");

f = open( help.html ,  w )
f.write(text);
f.close();

Run it just like any other monkeyrunner script:

$ monkeyrunner help.py
问题回答

After I have all codes in my machine (i.e, repo sync), it is at mydroid/sdk/monkeyrunner/scripts along with other three:

help.py monkey_playback.py monkey_recorder.py mr_pydoc.py

This is brilliant answer https://stackoverflow.com/a/4470513/551383 but if you really want this file is in android source i.e. http://androidxref.com/4.2_r1/xref/sdk/monkeyrunner/scripts/help.py

http://androidxref.com/source/xref/sdk/monkeyrunner/scripts/help.py

I believe the documentation on the website starts from that script, but I m pretty sure somebody edits it a bit afterwards as well.

There s an error in monkeyrunner s help documentation (monkeyrunner Built-in Help), you should use parameters in another order:

monkeyrunner help.py <format> <outfile>

And don t forget about specifying a full path to the script, if you re running it outside of the monkeyrunner.bat directory (android monkeyrunner scripts).
If you don t have Repo Sync, described by users above, you can find the sources (including help.py), for example, here: monkeyrunner scripts.

I opened an issue at Google Code (Issue 26259: monkeyrunner Built-in Help Description Error) and I hope that they ll fix it soon.





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签