Convert to Python3 (#160)

* Convert to python3

* Remove .bak

* Remove (( and )) in print
This commit is contained in:
Ralic Lo 2017-05-18 18:40:43 -07:00 committed by Arun Prakash Jana
parent 6f3ca731d6
commit 7ee95f7f1e
3 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ def bookmarks():
result_bookmark = {
'url': bookmark[1],
'title': bookmark[2],
'tags': list(filter(None, bookmark[3].split(','))),
'tags': list([_f for _f in bookmark[3].split(',') if _f]),
'description': bookmark[4]
}
result['bookmarks'].append(result_bookmark)
@ -92,7 +92,7 @@ def bookmark_api(id):
result = {
'url': bookmark[1],
'title': bookmark[2],
'tags': list(filter(None, bookmark[3].split(','))),
'tags': list([_f for _f in bookmark[3].split(',') if _f]),
'description': bookmark[4]
}
return jsonify(result)
@ -199,7 +199,7 @@ def bookmark_range_operations(starting_id, ending_id):
bookmarks[i] = {
'url': bookmark[1],
'title': bookmark[2],
'tags': list(filter(None, bookmark[3].split(','))),
'tags': list([_f for _f in bookmark[3].split(',') if _f]),
'description': bookmark[4]
}
return jsonify(result)
@ -247,7 +247,7 @@ def search_bookmarks():
'id': bookmark[0],
'url': bookmark[1],
'title': bookmark[2],
'tags': list(filter(None, bookmark[3].split(','))),
'tags': list([_f for _f in bookmark[3].split(',') if _f]),
'description': bookmark[4]
}
results['bookmarks'].append(result_bookmark)

View File

@ -140,7 +140,7 @@ def test_edit_at_prompt(nav, is_editor_valid_retval, edit_rec_retval):
@pytest.mark.parametrize(
'field_filter, single_record',
product(range(4), [True, False])
product(list(range(4)), [True, False])
)
def test_format_json(field_filter, single_record):
"""test func."""

View File

@ -92,7 +92,7 @@ class TestBukuDb(unittest.TestCase):
except KeyError:
pass
self.assertEqual(dbdir_relative_expected, BukuDb.get_default_dbdir())
for key, value in originals.items():
for key, value in list(originals.items()):
os.environ[key] = value
# # not sure how to test this in nondestructive manner
@ -929,7 +929,7 @@ def split_and_test_membership(a, b):
def inclusive_range(start, end):
return range(start, end + 1)
return list(range(start, end + 1))
def normalize_range(db_len, low, high):