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

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

Issue 29968558: Issue 7037 - [XTM Integration] Make REST API url customizable
Patch Set: Removed unnecessary print statements Created Sept. 17, 2019, 12:24 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/constants.py ('k') | cms/translations/xtm/utils.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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.client_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 print('Caught exception: ', err)
79 sys.exit(err) 80 sys.exit(err)
80 81
81 logging.info(const.InfoMessages.PROJECT_CREATED.format(project_id)) 82 logging.info(const.InfoMessages.PROJECT_CREATED.format(project_id))
82 utils.log_resulting_jobs(resulting_jobs) 83 utils.log_resulting_jobs(resulting_jobs)
83 84
84 if args.save_id: 85 if args.save_id:
85 source.write_to_config( 86 source.write_to_config(
86 const.Config.XTM_SECTION, 87 const.Config.XTM_SECTION,
87 const.Config.PROJECT_OPTION, 88 const.Config.PROJECT_OPTION,
88 str(project_id), 89 str(project_id),
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 utils.write_to_file(zf.read(name), path) 182 utils.write_to_file(zf.read(name), path)
182 logging.info(const.InfoMessages.FILE_SAVED.format( 183 logging.info(const.InfoMessages.FILE_SAVED.format(
183 path, 184 path,
184 zf.getinfo(name).file_size, 185 zf.getinfo(name).file_size,
185 )) 186 ))
186 logging.info(const.InfoMessages.GREETINGS) 187 logging.info(const.InfoMessages.GREETINGS)
187 except zipfile.BadZipfile: 188 except zipfile.BadZipfile:
188 sys.exit(const.ErrorMessages.NO_TARGET_FILES_FOUND) 189 sys.exit(const.ErrorMessages.NO_TARGET_FILES_FOUND)
189 except IOError: 190 except IOError:
190 sys.exit(const.ErrorMessages.COULD_NOT_SAVE_FILES) 191 sys.exit(const.ErrorMessages.COULD_NOT_SAVE_FILES)
OLDNEW
« no previous file with comments | « cms/translations/xtm/constants.py ('k') | cms/translations/xtm/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld