forked from quantifiedcode/quantifiedcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
95 lines (86 loc) · 2.56 KB
/
setup.py
File metadata and controls
95 lines (86 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# -*- coding: utf-8 -*-
"""
Contains information needed to set up the plugin.
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from .backend.tasks import hooks
from .backend.models import GitRepository, GitSnapshot, GitBranch
from .backend.api.v1.routes import routes
from .backend.providers.snapshot import resolve
from .backend.providers.file_content import get_file_content_by_sha
import os
plugin_path = os.path.dirname(__file__)
config = {
'api': {
'version': 'v1',
'routes': routes,
'module': 'git',
},
'providers' : {
'snapshot.resolve' : {
'source' : 'git',
'provider' : resolve
},
'file_revision.content_by_sha' : {
'source' : 'git',
'provider' : get_file_content_by_sha
}
},
'models': [GitRepository, GitSnapshot, GitBranch],
#we declare an additional template directory
'settings' : {
'backend' : {
'template_paths' : {
'200_git' : os.path.join(plugin_path, 'backend/templates')
}
}
},
'yaml_settings' : [os.path.join(plugin_path,'settings/default.yml')],
'frontend' : {
'static_files' : os.path.join(plugin_path,'frontend/build/static'),
'optimized_static_files' : os.path.join(plugin_path,'frontend/build/optimized/static'),
'settings' : {
'settingsModule' : 'git/settings'
}
},
'tasks': [],
'exports' : {
'ProjectDetails' : (
{
'git' : ('public_key',
'url'
)},
{
'git_branches' : {'*' : ('name', 'remote',{'head_snapshot' : ('pk',)},{'last_analyzed_snapshot' : ('pk',)})}
}
),
'SnapshotDetails' : (
{
'git_snapshot' : (
'sha',
'hash',
'committer_date',
'author_date',
'author_name',
'committer_date_ts',
'author_date_ts',
'tree_sha',
'log',
),
},
{
'branch' : ('name',)
}
)
},
'includes' : {
'ProjectDetails' : ['git','git_branches'],
'SnapshotDetails' : ['git_snapshot']
},
'hooks': hooks,
'name': 'Git',
'requires': [], # e.g. git v1
'description': "Currently only register Git hooks"
}