Skip to content

Commit

Permalink
Remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Jan 17, 2019
1 parent 8d5bebe commit b666bb8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
18 changes: 0 additions & 18 deletions pybossa/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,6 @@ def to_json(self):
prev=self.has_prev)


def unicode_csv_reader(unicode_csv_data, dialect=csv.excel, **kwargs):
"""Unicode CSV reader."""
# This code is taken from http://docs.python.org/library/csv.html#examples
# csv.py doesn't do Unicode; encode temporarily as UTF-8:
csv_reader = csv.reader(utf_8_encoder(unicode_csv_data),
dialect=dialect, **kwargs)
for row in csv_reader:
# decode UTF-8 back to Unicode, cell by cell:
yield [cell.encode('utf-8') for cell in row]


def utf_8_encoder(unicode_csv_data):
"""UTF8 encoder for CSV data."""
# This code is taken from http://docs.python.org/library/csv.html#examples
for line in unicode_csv_data:
yield line.encode('utf-8')


def get_user_signup_method(user):
"""Return which OAuth sign up method the user used."""
msg = 'Sorry, there is already an account with the same e-mail.'
Expand Down
1 change: 0 additions & 1 deletion test/test_admin_export_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import json
import io
from default import with_context
from pybossa.util import unicode_csv_reader
from factories import UserFactory
from helper import web

Expand Down
3 changes: 1 addition & 2 deletions test/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from mock import patch, Mock, call, MagicMock
from flask import redirect
from itsdangerous import BadSignature
from pybossa.util import get_user_signup_method, unicode_csv_reader
from pybossa.util import get_user_signup_method
from bs4 import BeautifulSoup
from requests.exceptions import ConnectionError
from pandas.errors import EmptyDataError
Expand Down Expand Up @@ -5216,7 +5216,6 @@ def test_53_export_task_runs_csv(self):
assert extracted_filename_info_only == 'project1_task_run_info_only.csv', zip.namelist()[1]
zip_data = zip.read(str(extracted_filename))
csv_content = StringIO(zip_data.decode('utf-8'))
# csvreader = unicode_csv_reader(csv_content)
csv_df = pd.read_csv(csv_content)
project = db.session.query(Project)\
.filter_by(short_name=project.short_name)\
Expand Down

0 comments on commit b666bb8

Please sign in to comment.