add indexing category

This commit is contained in:
Alan Hamlett 2018-04-07 14:56:58 -07:00
parent e585fbb4a8
commit 358308c993
4 changed files with 7 additions and 3 deletions

View file

@ -32,7 +32,8 @@ optional arguments:
"domain" or "app". Defaults to "file".
--category CATEGORY Category of this heartbeat activity. Can be "coding",
"building", "debugging", "running tests", "browsing",
"code reviewing" or "designing". Defaults to "coding".
"code reviewing", "designing" or "indexing". Defaults
to "coding".
--proxy PROXY Optional proxy configuration. Supports HTTPS and SOCKS
proxies. For example: https://user:pass@host:port or
socks5://user:pass@host:port or domain\user:pass

View file

@ -510,6 +510,7 @@ class ArgumentsTestCase(TestCase):
'browsing',
'code reviewing',
'designing',
'indexing',
]
for category in valid_categories:

View file

@ -88,8 +88,9 @@ def parse_arguments():
action=StoreWithoutQuotes,
help='Category of this heartbeat activity. Can be ' +
'"coding", "building", "debugging", ' +
'"running tests", "browsing", "code reviewing" ' +
' or "designing". Defaults to "coding".')
'"running tests", "browsing", ' +
'"code reviewing", "designing" or "indexing". ' +
'Defaults to "coding".')
parser.add_argument('--proxy', dest='proxy', action=StoreWithoutQuotes,
help='Optional proxy configuration. Supports HTTPS '+
'and SOCKS proxies. For example: '+

View file

@ -68,6 +68,7 @@ class Heartbeat(object):
'browsing',
'code reviewing',
'designing',
'indexing',
]
if self.category not in allowed_categories:
self.category = None