forked from OCA/maintainer-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoca_projects.py
206 lines (192 loc) · 6.88 KB
/
oca_projects.py
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# -*- coding: utf-8 -*-
"""
Data about OCA Projects, with a few helper functions.
OCA_PROJECTS: dictionary of OCA Projects mapped to the list of related
repository names, based on
https://odoo-community.org/page/List
OCA_REPOSITORY_NAMES: list of OCA repository names
"""
from github_login import login
ALL = ['OCA_PROJECTS', 'OCA_REPOSITORY_NAMES', 'url']
OCA_PROJECTS = {
'accounting': ['account-analytic',
'account-budgeting',
'account-closing',
'account-consolidation',
'account-financial-tools',
'account-financial-reporting',
'account-invoice-reporting',
'account-invoicing',
'account-fiscal-rule',
'operating-unit',
'intrastat',
],
# 'backport': ['OCB',
# ],
'banking': ['bank-payment',
'bank-statement-reconcile',
'bank-statement-import',
'account-payment',
],
'community': ['maintainer-tools',
'maintainer-quality-tools',
'runbot-addons',
],
'connector': ['connector',
'connector-ecommerce',
'queue',
],
'connector AccountEdge': ['connector-accountedge'],
'connector LIMS': ['connector-lims'],
'connector CMIS': ['connector-cmis'],
'connector Magento': ['connector-magento'],
'connector Prestashop': ['connector-prestashop'],
'connector Sage': ['connector-sage'],
'connector Salesforce': ['connector-salesforce'],
'connector WooCommerce': ['connector-woocommerce'],
'connector Lengow': ['connector-lengow'],
'crm sales marketing': ['sale-workflow',
'crm',
'partner-contact',
'sale-financial',
'sale-reporting',
'commission',
'event',
'survey',
],
'document': ['knowledge'],
'ecommerce': ['e-commerce'],
'edi': ['edi'],
'financial control': ['margin-analysis'],
'Infrastructure': ['infrastructure-dns'],
'geospatial': ['geospatial'],
'hr': ['hr-timesheet',
'hr',
'department',
],
'connector-odoo2odoo': ['connector-odoo2odoo'],
'multi-company': ['multi-company'],
'l10n-argentina': ['l10n-argentina'],
'l10n-belgium': ['l10n-belgium'],
'l10n-brazil': ['l10n-brazil'],
'l10n-cambodia': ['l10n-cambodia'],
'l10n-canada': ['l10n-canada'],
'l10n-chile': ['l10n-chile'],
'l10n-china': ['l10n-china'],
'l10n-colombia': ['l10n-colombia'],
'l10n-costa-rica': ['l10n-costa-rica'],
'l10n-ecuador': ['l10n-ecuador'],
'l10n-ethiopia': ['l10n-ethiopia'],
'l10n-finland': ['l10n-finland'],
'l10n-france': ['l10n-france'],
'l10n-germany': ['l10n-germany'],
'l10n-india': ['l10n-india'],
'l10n-indonesia': ['l10n-indonesia'],
'l10n-iran': ['l10n-iran'],
'l10n-ireland': ['l10n-ireland'],
'l10n-italy': ['l10n-italy'],
'l10n-luxemburg': ['l10n-luxemburg'],
'l10n-mexico': ['l10n-mexico'],
'l10n-morocco': ['l10n-morocco'],
'l10n-netherlands': ['l10n-netherlands'],
'l10n-norway': ['l10n-norway'],
'l10n-peru': ['l10n-peru'],
'l10n-portugal': ['l10n-portugal'],
'l10n-romania': ['l10n-romania'],
'l10n-slovenia': ['l10n-slovenia'],
'l10n-spain': ['l10n-spain'],
'l10n-switzerland': ['l10n-switzerland'],
'l10n-taiwan': ['l10n-taiwan'],
'l10n-thailand': ['l10n-thailand'],
'l10n-turkey': ['l10n-turkey'],
'l10n-usa': ['l10n-usa'],
'l10n-united-kingdom': ['l10n-united-kingdom'],
'l10n-venezuela': ['l10n-venezuela'],
'l10n-vietnam': ['l10n-vietnam'],
'logistics': ['carrier-delivery',
'stock-logistics-barcode',
'stock-logistics-workflow',
'stock-logistics-tracking',
'stock-logistics-warehouse',
'stock-logistics-reporting',
'rma',
],
'manufacturing': ['manufacture',
'manufacture-reporting',
],
'management system': ['management-system'],
'purchase': ['purchase-workflow',
'purchase-reporting',
],
'product': ['product-attribute',
'product-kitting',
'product-variant',
],
'project / services': ['project-reporting',
'project-service',
'contract',
'program',
'business-requirement',
'connector-redmine',
'connector-jira',
],
'social': ['social'],
'tools': ['reporting-engine',
'report-print-send',
'webkit-tools',
'server-tools',
'community-data-files',
'webhook',
'interface-github',
],
'vertical association': ['vertical-association'],
'vertical hotel': ['vertical-hotel'],
'vertical ISP': ['vertical-isp'],
'vertical edition': ['vertical-edition'],
'vertical education': ['vertical-education'],
'vertical medical': ['vertical-medical'],
'vertical NGO': ['vertical-ngo',
# XXX
],
'vertical construction': ['vertical-construction'],
'vertical real state': ['vertical-realstate'],
'vertical travel': ['vertical-travel'],
'web': ['web'],
'website': ['website',
'website-cms',
],
}
def get_repositories():
ignored = {
'odoo-community.org',
'contribute-md-template',
'maintainer-tools',
'maintainer-quality-tools',
'odoo-sphinx-autodoc',
'openupgradelib',
'connector-magento-php-extension',
'OCB',
'OpenUpgrade',
'pylint-odoo',
}
gh = login()
all_repos = [repo.name for repo in gh.iter_user_repos('OCA')
if repo.name not in ignored]
return all_repos
try:
OCA_REPOSITORY_NAMES = get_repositories()
except Exception as exc:
print exc
OCA_REPOSITORY_NAMES = []
for repos in OCA_PROJECTS.itervalues():
OCA_REPOSITORY_NAMES += repos
OCA_REPOSITORY_NAMES.sort()
_OCA_REPOSITORY_NAMES = set(OCA_REPOSITORY_NAMES)
_URL_MAPPINGS = {'git': '[email protected]:%s/%s.git',
'https': 'https://github.com/%s/%s.git',
}
def url(project_name, protocol='git', org_name='OCA'):
"""get the URL for an OCA project repository"""
if project_name not in _OCA_REPOSITORY_NAMES:
raise ValueError('Unknown project', project_name)
return _URL_MAPPINGS[protocol] % (org_name, project_name)