version 0.2.1. using new actions api scheme.

This commit is contained in:
Alan Hamlett
2013-07-07 18:38:01 -07:00
parent 227b7197d3
commit 2357f1325c
14 changed files with 3056 additions and 223 deletions

View 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)