Пример #1
0
#  print client.get_user('me')
  print client.get_users()
#  print(userinfo["username"])
  

#  print client.get_users()
#  print client.get_lists({"num":1})
#  print client.get_lists({"search":"created"})
#  print client.update_user("4fd1269037eaef23070024e7", {"name":"ramtestupdated"} )

  # read in the CSV File (skip header row)

  ld = {}

  textlist = om_utils.read_all_csv_lines()       

  #one list dictionary
  ld = create_list_dict(textlist)

  #one dictionary for each item
  idictsList = create_item_dicts(textlist)

  # create a new list
  newlist =  client.create_list(ld)
  print newlist

  # check if the list was successfully created.
  if "success" in newlist:
    print "List Creation failed"
    print "Exiting Script"
Пример #2
0
    client = OpenMindsThreeLeggedClient(FLAGS.om_access_token, FLAGS.om_host)
  else:
    client = OpenMindsTwoLeggedClient(FLAGS.om_key, FLAGS.om_secret, FLAGS.om_host)

#  print client.get_user('me')
#  print client.get_users()
#  print(userinfo["username"])
  

  ld = {}
  #  filename = 'newlist.csv'
  filename = 'jeplist2.csv'
  om_utils.log(filename) #debug stmt

  # read in the CSV File (skip header row)
  textlist = om_utils.read_all_csv_lines(filename)       
#  print "textlist"
#  print textlist

  #one list dictionary
  ld = create_list_dict(textlist)

  f_type = ld["format"]
  print "list of type", f_type 

  #one dictionary for each item
  idictsList = create_item_dicts(textlist,f_type,False)

  # create a new list
  newlist =  client.create_list(ld)
  #print newlist
Пример #3
0
                                          FLAGS.om_host)

#  print client.get_user('me')
    print client.get_users()
    #  print(userinfo["username"])

    #  print client.get_users()
    #  print client.get_lists({"num":1})
    #  print client.get_lists({"search":"created"})
    #  print client.update_user("4fd1269037eaef23070024e7", {"name":"ramtestupdated"} )

    # read in the CSV File (skip header row)

    ld = {}

    textlist = om_utils.read_all_csv_lines()

    #one list dictionary
    ld = create_list_dict(textlist)

    #one dictionary for each item
    idictsList = create_item_dicts(textlist)

    # create a new list
    newlist = client.create_list(ld)
    print newlist

    # check if the list was successfully created.
    if "success" in newlist:
        print "List Creation failed"
        print "Exiting Script"
                                            FLAGS.om_host)
    else:
        client = OpenMindsTwoLeggedClient(FLAGS.om_key, FLAGS.om_secret,
                                          FLAGS.om_host)

#  print client.get_user('me')
#  print client.get_users()
#  print(userinfo["username"])

    ld = {}
    #  filename = 'newlist.csv'
    filename = 'jeplist2.csv'
    om_utils.log(filename)  #debug stmt

    # read in the CSV File (skip header row)
    textlist = om_utils.read_all_csv_lines(filename)
    #  print "textlist"
    #  print textlist

    #one list dictionary
    ld = create_list_dict(textlist)

    f_type = ld["format"]
    print "list of type", f_type

    #one dictionary for each item
    idictsList = create_item_dicts(textlist, f_type, False)

    # create a new list
    newlist = client.create_list(ld)
    #print newlist