mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
version 0.2.1. using new actions api scheme.
This commit is contained in:
35
packages/wakatime/project.py
Normal file
35
packages/wakatime/project.py
Normal file
@ -0,0 +1,35 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
wakatime.project
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
Returns a project for the given file.
|
||||
|
||||
:copyright: (c) 2013 Alan Hamlett.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
from .projects.base import BaseProject
|
||||
from .projects.git import Git
|
||||
from .projects.mercurial import Mercurial
|
||||
from .projects.subversion import Subversion
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
PLUGINS = [
|
||||
Git,
|
||||
Mercurial,
|
||||
Subversion,
|
||||
]
|
||||
|
||||
|
||||
def find_project(path):
|
||||
for plugin in PLUGINS:
|
||||
project = plugin(path)
|
||||
if project.config:
|
||||
return project
|
||||
return BaseProject(path)
|
Reference in New Issue
Block a user