upgraded wakatime package to v0.1.4
This commit is contained in:
parent
42e1420649
commit
68fd214b3a
2 changed files with 10 additions and 7 deletions
|
@ -12,7 +12,7 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
__title__ = 'wakatime'
|
__title__ = 'wakatime'
|
||||||
__version__ = '0.1.3'
|
__version__ = '0.1.4'
|
||||||
__author__ = 'Alan Hamlett'
|
__author__ = 'Alan Hamlett'
|
||||||
__license__ = 'BSD'
|
__license__ = 'BSD'
|
||||||
__copyright__ = 'Copyright 2013 Alan Hamlett'
|
__copyright__ = 'Copyright 2013 Alan Hamlett'
|
||||||
|
@ -88,10 +88,10 @@ def parseArguments(argv):
|
||||||
|
|
||||||
def get_api_key(configFile):
|
def get_api_key(configFile):
|
||||||
if not configFile:
|
if not configFile:
|
||||||
configFile = '~/.wakatime.conf'
|
configFile = os.path.join(os.path.expanduser('~'), '.wakatime.conf')
|
||||||
api_key = None
|
api_key = None
|
||||||
try:
|
try:
|
||||||
cf = open(os.path.expanduser(configFile))
|
cf = open(configFile)
|
||||||
for line in cf:
|
for line in cf:
|
||||||
line = line.split('=', 1)
|
line = line.split('=', 1)
|
||||||
if line[0] == 'api_key':
|
if line[0] == 'api_key':
|
||||||
|
@ -170,9 +170,13 @@ def main(argv=None):
|
||||||
args = parseArguments(argv)
|
args = parseArguments(argv)
|
||||||
setup_logging(args, __version__)
|
setup_logging(args, __version__)
|
||||||
if os.path.isfile(args.targetFile):
|
if os.path.isfile(args.targetFile):
|
||||||
|
tags = []
|
||||||
|
name = None
|
||||||
project = find_project(args.targetFile)
|
project = find_project(args.targetFile)
|
||||||
tags = project.tags()
|
if project:
|
||||||
if send_action(project=project.name(), tags=tags, **vars(args)):
|
tags = project.tags()
|
||||||
|
name = project.name()
|
||||||
|
if send_action(project=name, tags=tags, **vars(args)):
|
||||||
return 0
|
return 0
|
||||||
return 102
|
return 102
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from .projects.base import BaseProject
|
|
||||||
from .projects.git import Git
|
from .projects.git import Git
|
||||||
from .projects.mercurial import Mercurial
|
from .projects.mercurial import Mercurial
|
||||||
from .projects.subversion import Subversion
|
from .projects.subversion import Subversion
|
||||||
|
@ -32,4 +31,4 @@ def find_project(path):
|
||||||
project = plugin(path)
|
project = plugin(path)
|
||||||
if project.process():
|
if project.process():
|
||||||
return project
|
return project
|
||||||
return BaseProject(path)
|
return None
|
||||||
|
|
Loading…
Reference in a new issue