@gen.coroutine
def main():
  parse_command_line()
  assert options.password
  client = AsyncHTTPClient()

  cases = parse_cases.parse_cases(options.filename)

  url = 'https://api.bitbucket.org/1.0/repositories/%s/issues' % options.repo
  for subject, assigned_to, body in cases:
    args = {'title': utf8(subject), 'content': utf8(body)}
    if assigned_to:
      args['responsible'] = assigned_to
    response = yield client.fetch(url, method='POST', body=urllib.urlencode(args),
                                  auth_username=options.username, auth_password=options.password)
    print response, response.body
dataset/ETHPy150Open viewfinderco/viewfinder/experimental/fogbugz_export/upload_issues.py/main/original