Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ __pycache__
.pytest_cache
.tox
MANIFEST

# IDE
.idea
.idea/*

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i use pycharm for python work, just thought its good to have these in the .gitignore to avoid idea folder from getting checked in

7 changes: 2 additions & 5 deletions splits/readers.py
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,
Expand Down Expand Up @@ -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):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shortening the chained comparison problem

break
elif line.endswith('\n'):
break
Expand All @@ -96,7 +93,7 @@ def readline(self, limit=None):

return line

def readlines(self, sizehint=None):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaning up because : sizehint is unused

def readlines(self):
all_lines = []
line = self.readline()

Expand Down
1 change: 0 additions & 1 deletion splits/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import boto.s3
import boto.s3.connection
import boto.provider
import zipfile

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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

Expand Down
2 changes: 0 additions & 2 deletions splits/writers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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


Expand Down
4 changes: 2 additions & 2 deletions test/test_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were 2 tests with the same name, separating them as test_*_1 & test_*_2

for index, x in enumerate(range(0, 19)):
char = self.reader.read(1)
if index % 2 == 0:
Expand All @@ -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):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were 2 tests with the same name, separating them as test_*_1 & test_*_2

chars = self.reader.read(11)
self.assertEquals(chars, '0\n1\n2\n3\n4\n5')

Expand Down