2013-07-20 22:28:38 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
2015-03-09 22:23:29 +00:00
|
|
|
wakatime.cli
|
2013-07-20 22:28:38 +00:00
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
2013-12-13 14:35:49 +00:00
|
|
|
Command-line entry point.
|
2013-07-20 22:28:38 +00:00
|
|
|
|
|
|
|
:copyright: (c) 2013 Alan Hamlett.
|
|
|
|
:license: BSD, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
|
2013-07-23 01:32:12 +00:00
|
|
|
import os
|
2013-07-20 22:28:38 +00:00
|
|
|
import sys
|
2015-07-29 07:03:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
# get path to local wakatime package
|
|
|
|
package_folder = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
# add local wakatime package to sys.path
|
|
|
|
sys.path.insert(0, package_folder)
|
|
|
|
|
|
|
|
# import local wakatime package
|
|
|
|
try:
|
|
|
|
import wakatime
|
2015-08-25 07:42:37 +00:00
|
|
|
except (TypeError, ImportError):
|
2015-07-29 07:03:18 +00:00
|
|
|
# on Windows, non-ASCII characters in import path can be fixed using
|
|
|
|
# the script path from sys.argv[0].
|
|
|
|
# More info at https://github.com/wakatime/wakatime/issues/32
|
|
|
|
package_folder = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
|
|
|
|
sys.path.insert(0, package_folder)
|
|
|
|
import wakatime
|
|
|
|
|
2013-07-20 22:28:38 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2015-08-25 07:42:37 +00:00
|
|
|
sys.exit(wakatime.main(sys.argv[1:]))
|