8000 PEP8 compliance and enable TravisCI · sotnich/server-client-python@dcf740d · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit dcf740d

Browse files
authored
PEP8 compliance and enable TravisCI
Bring this into pep8 compliance and enable pycodestyle (the future of pep8) in travisCI (tableau#27)
1 parent 0dab12e commit dcf740d

File tree

13 files changed

+12
-34
lines changed

13 files changed

+12
-34
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ python:
88
# command to install dependencies
99
install:
1010
- "pip install -e ."
11-
# - "pip install pep8"
11+
- "pip install pycodestyle"
1212
# command to run tests
1313
script:
1414
# Tests
1515
- python setup.py test
1616
# pep8 - disabled for now until we can scrub the files to make sure we pass before turning it on
17-
# - pep8 .
17+
- pycodestyle .

samples/explore_datasource.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@
3131
logging_level = getattr(logging, args.logging_level.upper())
3232
logging.basicConfig(level=logging_level)
3333

34-
##### SIGN IN #####
34+
# SIGN IN
3535
tableau_auth = TSC.TableauAuth(args.username, password)
3636
server = TSC.Server(args.server)
3737
with server.auth.sign_in(tableau_auth):
38-
3938
# Query projects for use when demonstrating publishing and updating
4039
pagination_item, all_projects = server.projects.get()
4140
default_project = next((project for project in all_projects if project.is_default()), None)
@@ -63,14 +62,3 @@
6362
print("\nConnections for {}: ".format(sample_datasource.name))
6463
print(["{0}({1})".format(connection.id, connection.datasource_name)
6564
for connection in sample_datasource.connections])
66-
67-
68-
69-
70-
71-
72-
73-
74-
75-
76-

samples/explore_workbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
logging_level = getattr(logging, args.logging_level.upper())
3333
logging.basicConfig(level=logging_level)
3434

35-
##### SIGN IN #####
35+
# SIGN IN
3636
tableau_auth = TSC.TableauAuth(args.username, password)
3737
server = TSC.Server(args.server)
3838
with server.auth.sign_in(tableau_auth):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
tests_require=[
2121
'requests-mock>=1.0,<1.1a0'
2222
]
23-
)
23+
)

tableauserverclient/models/datasource_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def from_response(cls, resp):
113113
tags, project_id, project_name, owner_id) = cls._parse_element(datasource_xml)
114114
datasource_item = cls(project_id)
115115
datasource_item._set_values(id, name, datasource_type, content_url, created_at, updated_at,
116-
tags, None, project_name, owner_id)
116+
tags, None, project_name, owner_id)
117117
all_datasource_items.append(datasource_item)
118118
return all_datasource_items
119119

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
class UnpopulatedPropertyError(Exception):
2-
pass
2+
pass

tableauserverclient/models/user_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def from_response(cls, resp):
144144
fullname, email, auth_setting, domain_name) = cls._parse_element(user_xml)
145145
user_item = cls(name, site_role)
146146
user_item._set_values(id, name, site_role, last_login, external_auth_user_id,
147-
fullname, email, auth_setting, domain_name)
147+
fullname, email, auth_setting, domain_name)
148148
all_user_items.add(user_item)
149149
return all_user_items
150150

tableauserverclient/models/workbook_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def from_response(cls, resp):
163163

164164
workbook_item = cls(project_id)
165165
workbook_item._set_values(id, name, content_url, created_at, updated_at,
166-
size, show_tabs, None, project_name, owner_id, tags, views)
166+
size, show_tabs, None, project_name, owner_id, tags, views)
167167
all_workbook_items.append(workbook_item)
168168
return all_workbook_items
169169

tableauserverclient/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
NAMESPACE = {'t': 'http://tableau.com/api'}
1+
NAMESPACE = {'t': 'http://tableau.com/api'}

tableauserverclient/server/endpoint/projects_endpoint.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,3 @@ def create(self, project_item):
5151
new_project = ProjectItem.from_response(server_response.text)[0]
5252
logger.info('Created new project (ID: {0})'.format(new_project.id))
5353
return new_project
54-
55-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
class NotSignedInError(Exception):
2-
pass
2+
pass

test/test_request_option.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,3 @@ def test_filter_tags_in(self):
8989
self.assertEqual(set(['weather']), matching_workbooks[0].tags)
9090
self.assertEqual(set(['safari']), matching_workbooks[1].tags)
9191
self.assertEqual(set(['sample']), matching_workbooks[2].tags)
92-
93-
94-
95-
96-
97-
98-
99-

test/test_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ def test_populate_preview_image_missing_id(self):
6262

6363
single_view._id = None
6464
single_view._workbook_id = '3cc6cd06-89ce-4fdc-b935-5294135d6d42'
65-
self.assertRaises(TSC.MissingRequiredFieldError, self.server.views.populate_preview_image, single_view)
65+
self.assertRaises(TSC.MissingRequiredFieldError, self.server.views.populate_preview_image, single_view)

0 commit comments

Comments
 (0)
0