Skip to content
This repository has been archived by the owner on Dec 30, 2021. It is now read-only.

Commit

Permalink
updated code quality fixed #40, thanks to @abdullahicyc for a quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
r0oth3x49 committed Jul 27, 2018
1 parent f29b8c7 commit 7e6467e
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions lynda/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,14 @@ def get_chapters(self):
return self._chapters

def _write_to_file(self, data, filename):
if pyver == 3:
with open(filename, 'wb', encoding='utf-8') as f:
try:
f.write(data)
except Exception as e:
retVal = {'status' : 'False', 'msg' : 'Python3 Exception : {}'.format(e)}
else:
retVal = {'status' : 'True', 'msg' : 'download'}
f.close()
else:
with open(filename, 'wb') as f:
try:
f.write(data)
except Exception as e:
retVal = {'status' : 'False', 'msg' : 'Python2 Exception : {}'.format(e)}
else:
retVal = {'status' : 'True', 'msg' : 'download'}
f.close()
with open(filename, 'wb') as f:
try:
f.write(data)
except Exception as e:
retVal = {'status' : 'False', 'msg' : 'Python3 Exception : {}'.format(e)}
else:
retVal = {'status' : 'True', 'msg' : 'download'}
f.close()

def course_description(self, filepath):
self.create_chapter(filepath=filepath)
Expand Down

0 comments on commit 7e6467e

Please sign in to comment.