sample_gdrive_rospy_client.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import rospy
4 from gdrive_ros.gdrive_ros_client import GDriveROSClient
5 
6 
7 def main():
8 
9  rospy.init_node('sample_gdrive_rospy_client')
10 
11  file_name = rospy.get_param('~file_name')
12  file_title = rospy.get_param('~file_title')
13  parents_path = rospy.get_param('~parents_path')
14 
15  client = GDriveROSClient()
16 
17  client.wait_for_gdrive_server()
18 
19  rospy.loginfo('Uploading files...')
20  ret = client.upload_file(file_name, file_title, parents_path=parents_path)
21  rospy.loginfo('Result: {}'.format(ret))
22 
23  rospy.loginfo('Uploading files...')
24  ret = client.upload_multiple_files([file_name], [file_title], parents_path=parents_path)
25  rospy.loginfo('Result: {}'.format(ret))
26 
27  rospy.loginfo('Successfully finished.')
28 
29 
30 if __name__=='__main__':
31  main()


gdrive_ros
Author(s): Shingo Kitagawa
autogenerated on Sat Jun 24 2023 02:40:20