Skip to content

Commit c010de9

Browse files
Whitespace cleanup in generator
1 parent bc8f0ff commit c010de9

6 files changed

Lines changed: 38 additions & 106 deletions

File tree

generator/generate_library.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def generate_library(spec, version_number, is_github_action):
154154
base_url = 'https://raw.githubusercontent.com/meraki/dashboard-api-python/master/meraki/'
155155
for file in non_generated:
156156
response = requests.get(f'{base_url}{file}')
157-
with open(f'meraki/{file}', 'w+', encoding='utf-8', newline='') as fp:
157+
with open(f'meraki/{file}', 'w+', encoding='utf-8', newline=None) as fp:
158158
contents = response.text
159159
if file == '__init__.py':
160160
start = contents.find('__version__ = ')
@@ -183,8 +183,8 @@ def generate_library(spec, version_number, is_github_action):
183183
print(f'...generating {scope}')
184184
section = scopes[scope]
185185

186-
with open(f'meraki/api/{scope}.py', 'w', encoding='utf-8', newline='') as output:
187-
with open(f'{template_dir}class_template.jinja2', encoding='utf-8', newline='') as fp:
186+
with open(f'meraki/api/{scope}.py', 'w', encoding='utf-8', newline=None) as output:
187+
with open(f'{template_dir}class_template.jinja2', encoding='utf-8', newline=None) as fp:
188188
class_template = fp.read()
189189
template = jinja_env.from_string(class_template)
190190
output.write(
@@ -194,8 +194,8 @@ def generate_library(spec, version_number, is_github_action):
194194
)
195195

196196
# Generate Asyncio API libraries
197-
async_output = open(f'meraki/aio/api/{scope}.py', 'w', encoding='utf-8', newline='')
198-
with open(f'{template_dir}async_class_template.jinja2', encoding='utf-8', newline='') as fp:
197+
async_output = open(f'meraki/aio/api/{scope}.py', 'w', encoding='utf-8', newline=None)
198+
with open(f'{template_dir}async_class_template.jinja2', encoding='utf-8', newline=None) as fp:
199199
class_template = fp.read()
200200
template = jinja_env.from_string(class_template)
201201
async_output.write(
@@ -205,8 +205,8 @@ def generate_library(spec, version_number, is_github_action):
205205
)
206206

207207
# Generate Action Batch API libraries
208-
batch_output = open(f'meraki/api/batch/{scope}.py', 'w', encoding='utf-8', newline='')
209-
with open(f'{template_dir}batch_class_template.jinja2', encoding='utf-8', newline='') as fp:
208+
batch_output = open(f'meraki/api/batch/{scope}.py', 'w', encoding='utf-8', newline=None)
209+
with open(f'{template_dir}batch_class_template.jinja2', encoding='utf-8', newline=None) as fp:
210210
class_template = fp.read()
211211
template = jinja_env.from_string(class_template)
212212
batch_output.write(
@@ -307,7 +307,7 @@ def generate_library(spec, version_number, is_github_action):
307307
call_line = 'return self._session.delete(metadata, resource)'
308308

309309
# Add function to files
310-
with open(f'{template_dir}function_template.jinja2', encoding='utf-8', newline='') as fp:
310+
with open(f'{template_dir}function_template.jinja2', encoding='utf-8', newline=None) as fp:
311311
function_template = fp.read()
312312
template = jinja_env.from_string(function_template)
313313
output.write(
@@ -430,7 +430,7 @@ def generate_library(spec, version_number, is_github_action):
430430
call_line = 'return action'
431431

432432
# Add function to files
433-
with open(f'{template_dir}batch_function_template.jinja2', encoding='utf-8', newline='') as fp:
433+
with open(f'{template_dir}batch_function_template.jinja2', encoding='utf-8', newline=None) as fp:
434434
function_template = fp.read()
435435
template = jinja_env.from_string(function_template)
436436
batch_output.write(

meraki/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
USE_ITERATOR_FOR_GET_PAGES,
4646
)
4747

48-
__version__ = '1.34.0'
48+
__version__ = '1.34.1'
4949

5050

5151
class DashboardAPI(object):

meraki/aio/api/organizations.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3521,27 +3521,6 @@ def getOrganizationUplinksStatuses(self, organizationId: str, total_pages=1, dir
35213521

35223522

35233523

3524-
def deleteOrganizationUser(self, organizationId: str, userId: str):
3525-
"""
3526-
**Delete a user and all of its authentication methods.**
3527-
https://developer.cisco.com/meraki/api-v1/#!delete-organization-user
3528-
3529-
- organizationId (string): Organization ID
3530-
- userId (string): User ID
3531-
"""
3532-
3533-
metadata = {
3534-
'tags': ['organizations', 'configure', 'users'],
3535-
'operation': 'deleteOrganizationUser'
3536-
}
3537-
organizationId = urllib.parse.quote(str(organizationId), safe='')
3538-
userId = urllib.parse.quote(str(userId), safe='')
3539-
resource = f'/organizations/{organizationId}/users/{userId}'
3540-
3541-
return self._session.delete(metadata, resource)
3542-
3543-
3544-
35453524
def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs):
35463525
"""
35473526
**Return a list of alert types to be used with managing webhook alerts**

meraki/api/batch/__init__.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
from meraki.api.batch.organizations import ActionBatchOrganizations
2-
from meraki.api.batch.networks import ActionBatchNetworks
3-
from meraki.api.batch.devices import ActionBatchDevices
4-
from meraki.api.batch.appliance import ActionBatchAppliance
5-
from meraki.api.batch.camera import ActionBatchCamera
6-
from meraki.api.batch.cellularGateway import ActionBatchCellularGateway
7-
from meraki.api.batch.insight import ActionBatchInsight
8-
from meraki.api.batch.sensor import ActionBatchSensor
9-
from meraki.api.batch.sm import ActionBatchSm
10-
from meraki.api.batch.switch import ActionBatchSwitch
11-
from meraki.api.batch.wireless import ActionBatchWireless
12-
13-
14-
# Batch class
15-
class Batch:
16-
def __init__(self):
17-
# Action Batch helper API endpoints by section
18-
self.organizations = ActionBatchOrganizations()
19-
self.networks = ActionBatchNetworks()
20-
self.devices = ActionBatchDevices()
21-
self.appliance = ActionBatchAppliance()
22-
self.camera = ActionBatchCamera()
23-
self.cellularGateway = ActionBatchCellularGateway()
24-
self.insight = ActionBatchInsight()
25-
self.sensor = ActionBatchSensor()
26-
self.sm = ActionBatchSm()
27-
self.switch = ActionBatchSwitch()
28-
self.wireless = ActionBatchWireless()
1+
from meraki.api.batch.organizations import ActionBatchOrganizations
2+
from meraki.api.batch.networks import ActionBatchNetworks
3+
from meraki.api.batch.devices import ActionBatchDevices
4+
from meraki.api.batch.appliance import ActionBatchAppliance
5+
from meraki.api.batch.camera import ActionBatchCamera
6+
from meraki.api.batch.cellularGateway import ActionBatchCellularGateway
7+
from meraki.api.batch.insight import ActionBatchInsight
8+
from meraki.api.batch.sensor import ActionBatchSensor
9+
from meraki.api.batch.sm import ActionBatchSm
10+
from meraki.api.batch.switch import ActionBatchSwitch
11+
from meraki.api.batch.wireless import ActionBatchWireless
12+
13+
14+
# Batch class
15+
class Batch:
16+
def __init__(self):
17+
# Action Batch helper API endpoints by section
18+
self.organizations = ActionBatchOrganizations()
19+
self.networks = ActionBatchNetworks()
20+
self.devices = ActionBatchDevices()
21+
self.appliance = ActionBatchAppliance()
22+
self.camera = ActionBatchCamera()
23+
self.cellularGateway = ActionBatchCellularGateway()
24+
self.insight = ActionBatchInsight()
25+
self.sensor = ActionBatchSensor()
26+
self.sm = ActionBatchSm()
27+
self.switch = ActionBatchSwitch()
28+
self.wireless = ActionBatchWireless()

meraki/api/batch/organizations.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,29 +1236,3 @@ def deleteOrganizationSamlIdp(self, organizationId: str, idpId: str):
12361236

12371237

12381238

1239-
1240-
1241-
def deleteOrganizationUser(self, organizationId: str, userId: str):
1242-
"""
1243-
**Delete a user and all of its authentication methods.**
1244-
https://developer.cisco.com/meraki/api-v1/#!delete-organization-user
1245-
1246-
- organizationId (string): Organization ID
1247-
- userId (string): User ID
1248-
"""
1249-
1250-
metadata = {
1251-
'tags': ['organizations', 'configure', 'users'],
1252-
'operation': 'deleteOrganizationUser'
1253-
}
1254-
resource = f'/organizations/{organizationId}/users/{userId}'
1255-
1256-
action = {
1257-
"resource": resource,
1258-
"operation": "destroy",
1259-
}
1260-
return action
1261-
1262-
1263-
1264-

meraki/api/organizations.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3521,27 +3521,6 @@ def getOrganizationUplinksStatuses(self, organizationId: str, total_pages=1, dir
35213521

35223522

35233523

3524-
def deleteOrganizationUser(self, organizationId: str, userId: str):
3525-
"""
3526-
**Delete a user and all of its authentication methods.**
3527-
https://developer.cisco.com/meraki/api-v1/#!delete-organization-user
3528-
3529-
- organizationId (string): Organization ID
3530-
- userId (string): User ID
3531-
"""
3532-
3533-
metadata = {
3534-
'tags': ['organizations', 'configure', 'users'],
3535-
'operation': 'deleteOrganizationUser'
3536-
}
3537-
organizationId = urllib.parse.quote(str(organizationId), safe='')
3538-
userId = urllib.parse.quote(str(userId), safe='')
3539-
resource = f'/organizations/{organizationId}/users/{userId}'
3540-
3541-
return self._session.delete(metadata, resource)
3542-
3543-
3544-
35453524
def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs):
35463525
"""
35473526
**Return a list of alert types to be used with managing webhook alerts**

0 commit comments

Comments
 (0)