Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: cms/translations/xtm/constants.py

Issue 29968558: Issue 7037 - [XTM Integration] Make REST API url customizable
Patch Set: Addressed comments Created Sept. 17, 2019, 12:22 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cms/translations/xtm/cli.py ('k') | cms/translations/xtm/projects_handler.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of the Adblock Plus web scripts, 1 # This file is part of the Adblock Plus web scripts,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 class ArgumentsHelp: 94 class ArgumentsHelp:
95 VERBOSE = 'Whether the script will log its work to stderr or not.' 95 VERBOSE = 'Whether the script will log its work to stderr or not.'
96 PROJECT_ID = ('The ID of the project we are working with. Will be ' 96 PROJECT_ID = ('The ID of the project we are working with. Will be '
97 'ignored if in "create" mode.') 97 'ignored if in "create" mode.')
98 LOGIN = 'Mode used to generate and save an API token from username+pass.' 98 LOGIN = 'Mode used to generate and save an API token from username+pass.'
99 PROJECT = ('Mode for handling projects: creation, files upload/ update/ ' 99 PROJECT = ('Mode for handling projects: creation, files upload/ update/ '
100 'download.') 100 'download.')
101 PROJECT_SOURCE_DIR = 'The source directory of the website.' 101 PROJECT_SOURCE_DIR = 'The source directory of the website.'
102 PROJECT_DOWNLOAD = ('Download the translation files from a project and ' 102 PROJECT_DOWNLOAD = ('Download the translation files from a project and '
103 'save them to disk.') 103 'save them to disk.')
104 API_URL = 'The url used when connecting to the API.'
104 105
105 class ProjectCreate: 106 class ProjectCreate:
106 MAIN = 'Sub-mode used to create a new project with XTM Cloud.' 107 MAIN = 'Sub-mode used to create a new project with XTM Cloud.'
107 NAME = 'The name of the project will have once created.' 108 NAME = 'The name of the project will have once created.'
108 DESC = 'TBD' 109 DESC = 'TBD'
109 CLIENT_ID = 'TBD' 110 CLIENT_ID = 'TBD'
110 REF_ID = 'TBD' 111 REF_ID = 'TBD'
111 WORKFLOW_ID = 'TBD' 112 WORKFLOW_ID = 'TBD'
112 SOURCE = 'The source language for this project. Default "en_US".' 113 SOURCE = 'The source language for this project. Default "en_US".'
113 SAVE_ID = ('Whether to save the id of the project to settings.ini or ' 114 SAVE_ID = ('Whether to save the id of the project to settings.ini or '
114 'not. Default False.') 115 'not. Default False.')
115 WORKFLOW_NAME = 'The name of the workflow used in the project.' 116 WORKFLOW_NAME = 'The name of the workflow used in the project.'
116 117
117 class ProjectUpload: 118 class ProjectUpload:
118 MAIN = 'Sub-mode used to upload files to an XTM Cloud project.' 119 MAIN = 'Sub-mode used to upload files to an XTM Cloud project.'
119 NO_OVERWRITE = ('If set, the script will not overwrite the files ' 120 NO_OVERWRITE = ('If set, the script will not overwrite the files '
120 'already present in the XTM environment.') 121 'already present in the XTM environment.')
121 122
122 123
123 class Config: 124 class Config:
124 XTM_SECTION = 'XTM' 125 XTM_SECTION = 'XTM'
125 PROJECT_OPTION = 'project_id' 126 PROJECT_OPTION = 'project_id'
126 MAIN_SECTION = 'general' 127 MAIN_SECTION = 'general'
127 DEFAULT_LOCALE_OPTION = 'defaultlocale' 128 DEFAULT_LOCALE_OPTION = 'defaultlocale'
129 URL_OPTION = 'url'
128 130
129 131
130 SUPPORTED_LOCALES = ( 132 SUPPORTED_LOCALES = (
131 'ab, aa_ET, ak, af_ZA, sq_AL, am_ET, am_ER, ar_AA, ar_AE,ar_BH, ar_DZ, ' 133 'ab, aa_ET, ak, af_ZA, sq_AL, am_ET, am_ER, ar_AA, ar_AE,ar_BH, ar_DZ, '
132 'ar_EG, ar_EH, ar_IQ, ar_JO, ar_KW, ar_LB, ar_LY, ar_MA, ar_MR, ar_OM, ' 134 'ar_EG, ar_EH, ar_IQ, ar_JO, ar_KW, ar_LB, ar_LY, ar_MA, ar_MR, ar_OM, '
133 'ar_PS, ar_QA, ar_SA, ar_SD, ar_SY, ar_TD, ar_TN, ar_YE, hy_AM, ' 135 'ar_PS, ar_QA, ar_SA, ar_SD, ar_SY, ar_TD, ar_TN, ar_YE, hy_AM, '
134 'hy_AM_arevela, hy_AM_arevmda, as_IN, ast_ES, ay_BO, az_AZ_Cyrl, ' 136 'hy_AM_arevela, hy_AM_arevmda, as_IN, ast_ES, ay_BO, az_AZ_Cyrl, '
135 'az_AZ_Latn, ba_RU, bal_IR, bh_IN, bi_VU, bs_BA_Cyrl, bs_BA_Latn, br_FR, ' 137 'az_AZ_Latn, ba_RU, bal_IR, bh_IN, bi_VU, bs_BA_Cyrl, bs_BA_Latn, br_FR, '
136 'bsk, my_MM, be_BY, cal, ca_ES, ceb, cha, ny_MW, zh_CN, zh_TW, zh_HK, ' 138 'bsk, my_MM, be_BY, cal, ca_ES, ceb, cha, ny_MW, zh_CN, zh_TW, zh_HK, '
137 'zh_SG, chk, co_FR, hr_HR, hr_BA, cs_CZ, eu_ES, bn_IN, bn_BD, bg_BG, ' 139 'zh_SG, chk, co_FR, hr_HR, hr_BA, cs_CZ, eu_ES, bn_IN, bn_BD, bg_BG, '
(...skipping 28 matching lines...) Expand all
166 168
167 class FileNames: 169 class FileNames:
168 MAX_LENGTH = 256 170 MAX_LENGTH = 256
169 PATH_SEP_REP = '___' 171 PATH_SEP_REP = '___'
170 172
171 173
172 UNDER_ANALYSIS_MESSAGE = ('403: {"reason":"Project is under analysis. ' 174 UNDER_ANALYSIS_MESSAGE = ('403: {"reason":"Project is under analysis. '
173 'Please wait for analysis end."}') 175 'Please wait for analysis end."}')
174 176
175 MAX_WAIT_TIME = 10 177 MAX_WAIT_TIME = 10
178
179 API_URL = 'https://wstest2.xtm-intl.com/rest-api/'
OLDNEW
« no previous file with comments | « cms/translations/xtm/cli.py ('k') | cms/translations/xtm/projects_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld