Skip to content

Commit

Permalink
Cleaning up some requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
mayhem committed Jun 25, 2016
1 parent 3dad1a5 commit 43a6fe0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jsonschema == 2.5.1
rauth == 0.7.1
Fabric == 1.10.2
raven[flask] == 5.5.0
python-memcached == 1.57
kafka-python == 0.9.4
cassandra-driver == 2.1.3
setproctitle == 1.1.8
markupsafe == 0.23
blist == 1.3.4
Expand Down
8 changes: 2 additions & 6 deletions webserver/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,12 @@ def profile(user_id):
@user_bp.route("/import")
@login_required
def import_data():
<<<<<<< HEAD
""" Displays the import page to user, giving various options """

# Return error if LASTFM_API_KEY is not given in config.py
if 'LASTFM_API_KEY' not in current_app.config or current_app.config['LASTFM_API_KEY'] == "":
return NotFound("LASTFM_API_KEY not specified.")

=======
""" Import page for listens from lastfm """
>>>>>>> export-listens
lastfm_username = request.args.get("lastfm_username")
if lastfm_username:
loader = render_template(
Expand All @@ -120,12 +116,12 @@ def import_data():
def export_data():
""" Exporting the data to json """
if request.method == "POST":
cassandra = webserver.create_cassandra()
db_conn = webserver.create_postgres()
filename = current_user.musicbrainz_id + "_lb-" + datetime.today().strftime('%Y-%m-%d') + ".json"

# Fetch output and convert it into dict with keys as indexes
output = []
for index, obj in enumerate(cassandra.fetch_listens(current_user.musicbrainz_id)):
for index, obj in enumerate(db_conn.fetch_listens(current_user.musicbrainz_id)):
dic = obj.data
dic['timestamp'] = obj.timestamp
dic['album_msid'] = None if obj.album_msid is None else str(obj.album_msid)
Expand Down

0 comments on commit 43a6fe0

Please sign in to comment.