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

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

Issue 29969555: Issue 7039 - [XTM Integration] Make parameter naming consistent with the API docs
Patch Set: Created Dec. 28, 2018, 2:51 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
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 project_id, resulting_jobs = utils.run_and_wait( 64 project_id, resulting_jobs = utils.run_and_wait(
65 api.create_project, 65 api.create_project,
66 XTMCloudException, 66 XTMCloudException,
67 const.UNDER_ANALYSIS_MESSAGE, 67 const.UNDER_ANALYSIS_MESSAGE,
68 const.InfoMessages.WAITING_FOR_PROJECT, 68 const.InfoMessages.WAITING_FOR_PROJECT,
69 name=name, 69 name=name,
70 description=args.desc, 70 description=args.desc,
71 reference_id=args.ref_id, 71 reference_id=args.ref_id,
72 target_languages=target_langs, 72 target_languages=target_langs,
73 customer_id=args.client_id, 73 customer_id=args.customer_id,
74 workflow_id=utils.extract_workflow_id(api, args), 74 workflow_id=utils.extract_workflow_id(api, args),
75 source_language=args.source_lang, 75 source_language=args.source_lang,
76 files=files_to_upload, 76 files=files_to_upload,
77 ) 77 )
78 except Exception as err: 78 except Exception as err:
79 sys.exit(err) 79 sys.exit(err)
80 80
81 logging.info(const.InfoMessages.PROJECT_CREATED.format(project_id)) 81 logging.info(const.InfoMessages.PROJECT_CREATED.format(project_id))
82 utils.log_resulting_jobs(resulting_jobs) 82 utils.log_resulting_jobs(resulting_jobs)
83 83
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 utils.write_to_file(zf.read(name), path) 181 utils.write_to_file(zf.read(name), path)
182 logging.info(const.InfoMessages.FILE_SAVED.format( 182 logging.info(const.InfoMessages.FILE_SAVED.format(
183 path, 183 path,
184 zf.getinfo(name).file_size, 184 zf.getinfo(name).file_size,
185 )) 185 ))
186 logging.info(const.InfoMessages.GREETINGS) 186 logging.info(const.InfoMessages.GREETINGS)
187 except zipfile.BadZipfile: 187 except zipfile.BadZipfile:
188 sys.exit(const.ErrorMessages.NO_TARGET_FILES_FOUND) 188 sys.exit(const.ErrorMessages.NO_TARGET_FILES_FOUND)
189 except IOError: 189 except IOError:
190 sys.exit(const.ErrorMessages.COULD_NOT_SAVE_FILES) 190 sys.exit(const.ErrorMessages.COULD_NOT_SAVE_FILES)
OLDNEW

Powered by Google App Engine
This is Rietveld