mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
5e34f3f6a7 | |||
d4441e5575 | |||
9eac8e2bd3 |
@ -3,6 +3,13 @@ History
|
||||
-------
|
||||
|
||||
|
||||
8.1.0 (2018-04-03)
|
||||
++++++++++++++++++
|
||||
|
||||
- Prefer Python3 over Python2 when running wakatime-cli core.
|
||||
- Improve detection of Python3 on Ubuntu 17.10 platforms.
|
||||
|
||||
|
||||
8.0.8 (2018-03-15)
|
||||
++++++++++++++++++
|
||||
|
||||
|
20
WakaTime.py
20
WakaTime.py
@ -7,7 +7,7 @@ Website: https://wakatime.com/
|
||||
==========================================================="""
|
||||
|
||||
|
||||
__version__ = '8.0.8'
|
||||
__version__ = '8.1.0'
|
||||
|
||||
|
||||
import sublime
|
||||
@ -305,13 +305,15 @@ def find_python_from_registry(location, reg=None):
|
||||
return val
|
||||
|
||||
|
||||
def find_python_in_folder(folder, headless=True):
|
||||
def find_python_in_folder(folder, python3=True, headless=True):
|
||||
pattern = re.compile(r'\d+\.\d+')
|
||||
|
||||
path = 'python'
|
||||
if folder is not None:
|
||||
if folder:
|
||||
path = os.path.realpath(os.path.join(folder, 'python'))
|
||||
if headless:
|
||||
if python3:
|
||||
path = u(path) + u('3')
|
||||
elif headless:
|
||||
path = u(path) + u('w')
|
||||
log(DEBUG, u('Looking for Python at: {0}').format(u(path)))
|
||||
try:
|
||||
@ -325,9 +327,13 @@ def find_python_in_folder(folder, headless=True):
|
||||
except:
|
||||
log(DEBUG, u(sys.exc_info()[1]))
|
||||
|
||||
if headless:
|
||||
path = find_python_in_folder(folder, headless=False)
|
||||
if path is not None:
|
||||
if python3:
|
||||
path = find_python_in_folder(folder, python3=False, headless=headless)
|
||||
if path:
|
||||
return path
|
||||
elif headless:
|
||||
path = find_python_in_folder(folder, python3=python3, headless=False)
|
||||
if path:
|
||||
return path
|
||||
|
||||
return None
|
||||
|
Reference in New Issue
Block a user