diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-07-07 12:40:28 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-07-07 12:40:28 +0530 |
commit | 3b6482cb0ab7eb51756213ccf7b7c8822fbda3d5 (patch) | |
tree | c3b3f6e35cb86e9c1998a8e969c1db77233fe309 /app/views.py | |
parent | bb730182584b09233ae955db41385864f087a4cb (diff) |
Fixed 10 Anti-Pattern issues
Diffstat (limited to 'app/views.py')
-rw-r--r-- | app/views.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/views.py b/app/views.py index b9ab620..fd1f466 100644 --- a/app/views.py +++ b/app/views.py @@ -105,9 +105,8 @@ def dock_upload(): target.save(secure_filename(target.filename)) ligand.save(secure_filename(ligand.filename)) buffer = "center_x="+cx+"\ncenter_y="+cy+"\ncenter_z="+cz+"\nsize_x="+sx+"\nsize_y="+sy+"\nsize_z="+sz - f = open("config.txt","w") - f.write(buffer) - f.close() + with open("config.txt","w") as f: + f.write(buffer) ligandB = convertToBinaryData(secure_filename(ligand.filename)) receptor = convertToBinaryData(secure_filename(target.filename)) config = convertToBinaryData("config.txt") |