-
Notifications
You must be signed in to change notification settings - Fork 8
minor code cleanup (first attempt) #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,7 @@ __pycache__ | |
| .pytest_cache | ||
| .tox | ||
| MANIFEST | ||
|
|
||
| # IDE | ||
| .idea | ||
| .idea/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| from splits.util import path_for_part | ||
|
|
||
|
|
||
| class SplitReader(object): | ||
| def __init__(self, | ||
| manifest_path_or_list, | ||
|
|
@@ -87,7 +84,7 @@ def readline(self, limit=None): | |
| else: | ||
| line += new_data | ||
|
|
||
| if limit > 0 and len(line) == limit: | ||
| if 0 < limit == len(line): | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shortening the |
||
| break | ||
| elif line.endswith('\n'): | ||
| break | ||
|
|
@@ -96,7 +93,7 @@ def readline(self, limit=None): | |
|
|
||
| return line | ||
|
|
||
| def readlines(self, sizehint=None): | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cleaning up because : |
||
| def readlines(self): | ||
| all_lines = [] | ||
| line = self.readline() | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| import boto.s3 | ||
| import boto.s3.connection | ||
| import boto.provider | ||
| import zipfile | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cleaning up unused imports in the file |
||
| import six.moves.urllib as urllib | ||
| from itertools import groupby | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| import os | ||
|
|
||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cleaning up unused imports in the file |
||
| from splits.util import path_for_part | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ def test_read(self): | |
| for index, x in enumerate(lines.split('\n')): | ||
| self.assertEquals(x, str(index)) | ||
|
|
||
| def test_read_n_chars(self): | ||
| def test_read_n_chars_1(self): | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there were 2 tests with the same name, separating them as |
||
| for index, x in enumerate(range(0, 19)): | ||
| char = self.reader.read(1) | ||
| if index % 2 == 0: | ||
|
|
@@ -40,7 +40,7 @@ def test_read_n_chars(self): | |
|
|
||
| self.assertEquals(self.reader.read(1), '') | ||
|
|
||
| def test_read_n_chars(self): | ||
| def test_read_n_chars_2(self): | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there were 2 tests with the same name, separating them as |
||
| chars = self.reader.read(11) | ||
| self.assertEquals(chars, '0\n1\n2\n3\n4\n5') | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i use
pycharmfor python work, just thought its good to have these in the.gitignoreto avoidideafolder from getting checked in