Skip to content

Commit

Permalink
Fix some E501 errors and moved import to the right location
Browse files Browse the repository at this point in the history
  • Loading branch information
antlarr committed Mar 23, 2017
1 parent b533e7b commit b0d53b0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions beetsplug/web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import flask
from flask import g
from werkzeug.routing import BaseConverter, PathConverter
from string import Template
import os
import json
import tempfile
from string import Template
import shlex
import six
import subprocess
Expand Down Expand Up @@ -273,13 +273,13 @@ def item_converted_file(item_id):
u' '.join(ui.decargs(args)), exc
)
)
attachment_filename = os.path.basename(util.py3_path(item.path))
attachment_filename = attachment_filename[:attachment_filename.rfind('.')] + extension
attach_filename = os.path.basename(util.py3_path(item.path))
attach_filename = attach_filename[:attach_filename.rfind('.')] + extension

response = flask.send_file(
util.py3_path(dest),
as_attachment=True,
attachment_filename=attachment_filename,
attachment_filename=attach_filename,
)
response.headers['Content-Length'] = os.path.getsize(dest)
return response
Expand Down Expand Up @@ -424,9 +424,11 @@ def func(lib, opts, args):

app.config['INCLUDE_PATHS'] = self.config['include_paths']
if 'convert_extension' in self.config:
app.config['convert_extension'] = self.config['convert_extension'].as_str()
app.config['convert_extension'] = \
self.config['convert_extension'].as_str()
if 'convert_command' in self.config:
app.config['convert_command'] = self.config['convert_command'].as_str()
app.config['convert_command'] = \
self.config['convert_command'].as_str()

# Enable CORS if required.
if self.config['cors']:
Expand Down

0 comments on commit b0d53b0

Please sign in to comment.