8000 fixed publish mode enums and typos in samples · LGraber/server-client-python@de61f87 · GitHub
[go: up one dir, main page]

Skip to content

Commit de61f87

Browse files
committed
fixed publish mode enums and typos in samples
1 parent ffd7683 commit de61f87

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

samples/explore_datasource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####
2-
# This script demonstrates how to use the Tableau Server API
2+
# This script demonstrates how to use the Tableau Server Client
33
# to interact with datasources. It explores the different
44
# functions that the Server API supports on datasources.
55
#
@@ -43,7 +43,7 @@
4343
if args.publish:
4444
if default_project is not None:
4545
new_datasource = TSC.DatasourceItem(default_project.id)
46-
new_datasource = server.datasources.publish(new_datasource, args.publish, server.PublishMode.Overwrite)
46+
new_datasource = server.datasources.publish(new_datasource, args.publish, TSC.Server.PublishMode.Overwrite)
4747
print("Datasource published. ID: {}".format(new_datasource.id))
4848
else:
4949
print("Publish failed. Could not find the default project.")

samples/explore_workbook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####
2-
# This script demonstrates how to use the Tableau Server API
2+
# This script demonstrates how to use the Tableau Server Client
33
# to interact with workbooks. It explores the different
44
# functions that the Server API supports on workbooks.
55
#
@@ -45,7 +45,7 @@
4545

4646
if default_project is not None:
4747
new_workbook = TSC.WorkbookItem(default_project.id)
48-
new_workbook = server.workbooks.publish(new_workbook, args.publish, server.PublishMode.Overwrite)
48+
new_workbook = server.workbooks.publish(new_workbook, args.publish, TSC.Server.PublishMode.Overwrite)
4949
print("Workbook published. ID: {}".format(new_workbook.id))
5050
else:
5151
print('Publish failed. Could not find the default project.')

samples/move_workbook_projects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
####
2-
# This script demonstrates how to use the Tableau Server API
2+
# This script demonstrates how to use the Tableau Server Client
33
# to move a workbook from one project to another. It will find
44
# a workbook that matches a given name and update it to be in
55
# the desired project.
66
#
7-
# To run the script, you must have installed Python 2.7.9 or later.
7+
# To run the script, you must have installed Python 2.7.X or 3.3 and later.
88
####
99

1010
import tableauserverclient as TSC

samples/move_workbook_sites.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
####
2-
# This script demonstrates how to use the Tableau Server API
2+
# This script demonstrates how to use the Tableau Server Client
33
# to move a workbook from one site to another. It will find
44
# a workbook that matches a given name, download the workbook,
55
# and then publish it to the destination site.
66
#
7-
# To run the script, you must have installed Python 2.7.9 or later.
7+
# To run the script, you must have installed Python 2.7.X or 3.3 and later.
88
####
99

1010
import tableauserverclient as TSC
@@ -74,7 +74,7 @@
7474
if target_project is not None:
7575
new_workbook = TSC.WorkbookItem(name=args.workbook_name, project_id=target_project.id)
7676
new_workbook = dest_server.workbooks.publish(new_workbook, workbook_path,
77-
mode=dest_server.PublishMode.Overwrite)
77+
mode=TSC.Server.PublishMode.Overwrite)
7878
print("Successfully moved {0} ({1})".format(new_workbook.name, new_workbook.id))
7979
else:
8080
error = "The default project could not be found."

samples/publish_workbook.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####
2-
# This script demonstrates how to use the Tableau Server API
2+
# This script demonstrates how to use the Tableau Server Client
33
# to publish a workbook to a Tableau server. It will publish
44
# a specified workbook to the 'default' project of the given server.
55
#
@@ -11,7 +11,7 @@
1111
# For more information, refer to the documentations on 'Publish Workbook'
1212
# (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm)
1313
#
14-
# To run the script, you must have installed Python 2.7.9 or later.
14+
# To run the script, you must have installed Python 2.7.X or 3.3 and later.
1515
####
1616

1717
import tableauserverclient as TSC
@@ -45,7 +45,7 @@
4545
# Step 3: If default project is found, form a new workbook item and publish.
4646
if default_project is not None:
4747
new_workbook = TSC.WorkbookItem(default_project.id)
48-
new_workbook = server.workbooks.publish(new_workbook, args.filepath, server.PublishMode.Overwrite)
48+
new_workbook = server.workbooks.publish(new_workbook, args.filepath, TSC.Server.PublishMode.Overwrite)
4949
print("Workbook published. ID: {0}".format(ne 6D4E w_workbook.id))
5050
else:
5151
error = "The default project could not be found."

samples/set_http_options.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
# This script demonstrates how to set http options. It will set the option
33
# to not verify SSL certificate, and query all workbooks on site.
44
#
5-
# For more information, refer to the documentation on 'Publish Workbook'
6-
# (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm)
7-
#
8-
# To run the script, you must have installed Python 2.7.9 or later.
5+
# To run the script, you must have installed Python 2.7.X or 3.3 and later.
96
####
107

118
import tableauserverclient as TSC

0 commit comments

Comments
 (0)
0