@@ -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 (
0 commit comments