Skip to content

Commit

Permalink
newline
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmiller87 committed Dec 8, 2019
1 parent cd3933e commit 7233e7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions asynccsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def aRetrieveData(self,gamertag,gamerdict):
newrow.insert(a+1,link)
return newrow

async def awriteCSV(self,newrows):
def awriteCSV(self,newrows):
'''write list of data to outputCSV file'''
for season in self.seasons:
header_dict = {
Expand All @@ -96,7 +96,7 @@ async def awriteCSV(self,newrows):
else:
self.header.extend(header_dict[k] for k in header_dict if k in self.playlists)

with open(self.csvoutput, 'w', encoding='latin-1') as csvwrite:
with open(self.csvoutput, 'w',newline='', encoding='latin-1') as csvwrite:
w = csv.writer(csvwrite, delimiter=',')
w.writerow(self.header)
for newrow in newrows:
Expand Down Expand Up @@ -167,7 +167,7 @@ async def singleRun():
responses = []
for task in pbar(asyncio.as_completed(tasks),desc='retrieve',total=len(tasks)):
responses.append(await task)
await inputoutput.awriteCSV(responses)
inputoutput.awriteCSV(responses)
logger.info("Finish for csv output:%s" % (results.output))

if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions synccsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def readCSVLinks(self):
scrape = Webscrape()
seasons = self.seasons

with open(self.csvinput, newline ='', encoding="ISO-8859-1") as csvread:
with open(self.csvinput, newline='', encoding="ISO-8859-1") as csvread:
reader = csv.reader(csvread)
i = 0
for row in reader:
Expand Down Expand Up @@ -104,7 +104,7 @@ def writeCSV(self):
else:
self.header.extend(header_dict[k] for k in header_dict if k in self.playlists)

with open(self.csvoutput, 'w', encoding='latin-1') as csvwrite:
with open(self.csvoutput, 'w', newline='', encoding='latin-1') as csvwrite:
w = csv.writer(csvwrite, delimiter=',')
w.writerow(self.header)
for newrow in self.newrows:
Expand Down

0 comments on commit 7233e7b

Please sign in to comment.