Closed Bug 1035254 Opened 10 years ago Closed 10 years ago

[mozdevice] - Add ADBAndroid.get_battery_percentage()

Categories

(Testing :: Mozbase, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla33

People

(Reporter: bc, Assigned: bc)

References

Details

Attachments

(2 files)

Add ADBAndroid.get_battery_percentage()
Attachment #8451699 - Flags: review?(wlachance)
Comment on attachment 8451699 [details] [diff] [review]
battery-status.patch

Review of attachment 8451699 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good!

::: testing/mozbase/mozdevice/mozdevice/adb_android.py
@@ +28,5 @@
> +        :raises: * ADBTimeoutError - raised if the command takes longer than
> +                   timeout seconds.
> +                 * ADBError - raised if the command exits with a non-zero
> +                   exit code.
> +

The raises seems a bit excessive in terms of documentation, I might just leave it out. Also I think there's an extra newline that's not needed.
Attachment #8451699 - Flags: review?(wlachance) → review+
How about if were to update the text descriptions of the exceptions with the docstrings for the exception classes and just list the possible exceptions that could be raised from a method? That would reduce a lot of the redundant text from the docstrings. I like being able to look at the docstring and see what kind of exceptions I should handle from a method.
wlach: this patch shows the changes I would make by removing the text from the various raises in the docstrings. As for the blank line preceeding the terminating """ in the docstrings... I've used that everywhere in adb.py and adb_android.py since Emacs automatically will insert the blank line when reformatting the docstring. I can take it out in both files for all of the docstrings if you want. Just let me know.
Attachment #8453202 - Flags: feedback?(wlachance)
Comment on attachment 8453202 [details] [diff] [review]
bug-1035254-docstring-changes.patch

This looks reasonable.
Attachment #8453202 - Flags: feedback?(wlachance) → feedback+
https://hg.mozilla.org/integration/mozilla-inbound/rev/6f559ac34685
Assignee: nobody → bclary
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/6f559ac34685
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: