comparison multimerge.py @ 8:8367463fe94d

Post-validate some settings.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 04 Jul 2016 12:54:53 +0300
parents f2ecfb3e04ee
children 01c933dba120
comparison
equal deleted inserted replaced
7:f2ecfb3e04ee 8:8367463fe94d
256 gcm_fatal("Invalid configuration, missing '{0}' section.".format(section)) 256 gcm_fatal("Invalid configuration, missing '{0}' section.".format(section))
257 257
258 # Parse the settings and validate 258 # Parse the settings and validate
259 cfg.mread(cfgparser, section) 259 cfg.mread(cfgparser, section)
260 260
261
262 ## Validate settings
263 if not cfg.dest_name and not cfg.dest_id:
264 gcm_fatal("Target calendar ID or name required, but not set.")
265
266
267 if cfg.dest_name:
268 cfg.mset("dest_name", cfg.mget("dest_name").strip())
269
270
261 ## Initialize and authorize API connection 271 ## Initialize and authorize API connection
262 credentials = gcm_get_credentials(cfg) 272 credentials = gcm_get_credentials(cfg)
263 http = credentials.authorize(httplib2.Http()) 273 http = credentials.authorize(httplib2.Http())
264 service = discovery.build("calendar", "v3", http=http) 274 service = discovery.build("calendar", "v3", http=http)
265 275