def main():
with open(flags.config) as input:
config = json.load(input)
if not config.get('disable_collection', False):
logger.info('Sending version information to stitchdata.com. ' +
'To disable sending anonymous usage data, set ' +
'the config parameter "disable_collection" to true')
threading.Thread(target=collect).start()
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
discoveryUrl = ('https://sheets.googleapis.com/$discovery/rest?'
'version=v4')
service = discovery.build('sheets', 'v4', http=http,
discoveryServiceUrl=discoveryUrl)
spreadsheet = get_spreadsheet(service, config['spreadsheet_id'])
input = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
state = None
state = persist_lines(service, spreadsheet, input)
emit_state(state)
logger.debug("Exiting normally")
评论列表
文章目录