Skip to content

Commit 48490f7

Browse files
committed
Clean up comments #52
Signed-off-by: John M. Horan <johnmhoran@gmail.com>
1 parent 59f769e commit 48490f7

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

src/deltacode/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def determine_delta(self):
104104
try:
105105
delta_old_files = old_index[path]
106106
except KeyError:
107-
# self.deltas['added'].append(Delta(new_file, None, 'added'))
108107
self.deltas['added'].append(Delta(new_file, None, 'added', 75))
109108
continue
110109

@@ -114,11 +113,9 @@ def determine_delta(self):
114113
for f in delta_old_files:
115114
# TODO: make sure sha1 is NOT empty
116115
if new_file.sha1 == f.sha1:
117-
# self.deltas['unmodified'].append(Delta(new_file, f, 'unmodified'))
118116
self.deltas['unmodified'].append(Delta(new_file, f, 'unmodified', 0))
119117
continue
120118
else:
121-
# delta = Delta(new_file, f, 'modified')
122119
delta = Delta(new_file, f, 'modified', 50)
123120
self.deltas['modified'].append(delta)
124121

@@ -134,7 +131,6 @@ def determine_delta(self):
134131
# This file already classified as 'modified' or 'unmodified' so do nothing
135132
new_index[path]
136133
except KeyError:
137-
# self.deltas['removed'].append(Delta(None, old_file, 'removed'))
138134
self.deltas['removed'].append(Delta(None, old_file, 'removed', 25))
139135
continue
140136

@@ -169,7 +165,6 @@ def update_deltas(self, added, removed):
169165
Convert the matched 'added' and 'removed' Delta objects to a combined
170166
'moved' Delta object and delete the 'added' and 'removed' objects.
171167
"""
172-
# self.deltas.get('moved').append(Delta(added.new_file, removed.old_file, 'moved'))
173168
self.deltas.get('moved').append(Delta(added.new_file, removed.old_file, 'moved', 0))
174169
self.deltas.get('added').remove(added)
175170
self.deltas.get('removed').remove(removed)
@@ -236,8 +231,6 @@ class Delta(object):
236231
object -- and the category that characterizes the comparison:
237232
'added', 'modified', 'moved', 'removed' or 'unmodified'.
238233
"""
239-
# def __init__(self, new_file=None, old_file=None, delta_type=None):
240-
# TODO: Should the default score be 0 or None? I've used 0 in the tests, e.g., test_Delta_to_dict_unmodified().
241234
def __init__(self, new_file=None, old_file=None, delta_type=None, score=0):
242235
self.new_file = new_file if new_file else File()
243236
self.old_file = old_file if old_file else File()
@@ -282,7 +275,6 @@ def to_dict(self):
282275
Check the 'category' attribute of the Delta object and return an
283276
OrderedDict comprising the 'category' and 'path' of the object.
284277
"""
285-
# delta = OrderedDict([('category', self.category)])
286278
delta = OrderedDict([
287279
('category', self.category),
288280
('score', self.score)

tests/test_deltacode.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,6 @@ def test_Delta_to_dict_removed(self):
10221022
]))
10231023
])
10241024

1025-
# delta = deltacode.Delta(None, old, 'removed')
10261025
delta = deltacode.Delta(None, old, 'removed', 25)
10271026

10281027
assert delta.to_dict() == expected
@@ -1051,7 +1050,6 @@ def test_Delta_to_dict_added(self):
10511050
('old', None)
10521051
])
10531052

1054-
# delta = deltacode.Delta(new, None, 'added')
10551053
delta = deltacode.Delta(new, None, 'added', 75)
10561054

10571055
assert delta.to_dict() == expected
@@ -1095,7 +1093,6 @@ def test_Delta_to_dict_modified(self):
10951093
]))
10961094
])
10971095

1098-
# delta = deltacode.Delta(new, old, 'modified')
10991096
delta = deltacode.Delta(new, old, 'modified', 50)
11001097

11011098
assert delta.to_dict() == expected
@@ -1139,7 +1136,6 @@ def test_Delta_to_dict_unmodified(self):
11391136
]))
11401137
])
11411138

1142-
# delta = deltacode.Delta(new, old, 'unmodified')
11431139
delta = deltacode.Delta(new, old, 'unmodified', 0)
11441140

11451141
assert delta.to_dict() == expected
@@ -1183,7 +1179,6 @@ def test_Delta_to_dict_moved(self):
11831179
]))
11841180
])
11851181

1186-
# delta = deltacode.Delta(new, old, 'moved')
11871182
delta = deltacode.Delta(new, old, 'moved', 0)
11881183

11891184
assert delta.to_dict() == expected

0 commit comments

Comments
 (0)