snoopycrimecop/snoopycrimecop — pull request #19 by sbesson (2012-11-30 13:40:36+00:00)
Title: Login or token

Allow Github connection using token or user/password. If only one argument is passed, try token connection first, then prompts for password if it fails.

Can be tested as:

```
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scc
>>> scc.get_github()
2012-11-30 13:36:36,898 DEBUG Create anonymous Github instance

>>> scc.get_github()
2012-11-30 13:36:38,089 DEBUG Retrieve anonymous Github instance

>>> scc.get_github(scc.get_token())
2012-11-30 13:36:49,673 DEBUG Calling 'git config --get github.token'
2012-11-30 13:36:50,493 DEBUG Create Github instance identified as snoopycrimecop

>>> scc.get_github(scc.get_token())
2012-11-30 13:36:51,657 DEBUG Calling 'git config --get github.token'
2012-11-30 13:36:52,073 DEBUG Retrieve Github instance identified as snoopycrimecop

>>> scc.get_github("sbesson")
2012-11-30 13:37:03,690 DEBUG Token identification failed
Enter password for user sbesson:
2012-11-30 13:37:07,106 DEBUG Create Github instance identified as sbesson

>>> scc.get_github("sbesson")
2012-11-30 13:37:14,885 DEBUG Retrieve Github instance identified as sbesson

```