bot-status.py: Misc. refactoring

* Use argparse vars instead of sys.argv
* Use None to indicate invalid build ID instead of -1.
  Also return None if gettting the build rev fails.
* When getting previous build ID, use default value None
  to next() instead of catching the exception
* Check prev_buildid is not None before using it
* In get_bot_status:
  * Build status dictionary only when we find a completed build
  * Return that dict right from the for loop instead of break,
    then fall out onto the return.
* When checking for a key in a dict "foo in d.keys()" is the
  same as "foo in d".

Change-Id: Id51ed6997c75ebb4327b6bf239f6e0ae43d54730
1 file changed