Fix problems from pyflakes output
This commit is contained in:
parent
349f5b19f7
commit
a855e92a98
@ -14,7 +14,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import bcrypt
|
import bcrypt
|
||||||
|
@ -14,10 +14,7 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
from string import split
|
|
||||||
from cgi import FieldStorage
|
from cgi import FieldStorage
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -33,9 +30,7 @@ from mediagoblin.decorators import require_active_login, get_user_media_entry
|
|||||||
from mediagoblin.tools.response import render_to_response, redirect
|
from mediagoblin.tools.response import render_to_response, redirect
|
||||||
from mediagoblin.tools.translate import pass_to_ugettext as _
|
from mediagoblin.tools.translate import pass_to_ugettext as _
|
||||||
from mediagoblin.tools.text import (
|
from mediagoblin.tools.text import (
|
||||||
clean_html, convert_to_tag_list_of_dicts,
|
convert_to_tag_list_of_dicts, media_tags_as_string)
|
||||||
media_tags_as_string)
|
|
||||||
from mediagoblin.tools.licenses import SUPPORTED_LICENSES
|
|
||||||
from mediagoblin.db.util import check_media_slug_used
|
from mediagoblin.db.util import check_media_slug_used
|
||||||
|
|
||||||
|
|
||||||
@ -185,7 +180,6 @@ def edit_profile(request):
|
|||||||
|
|
||||||
@require_active_login
|
@require_active_login
|
||||||
def edit_account(request):
|
def edit_account(request):
|
||||||
edit_username = request.GET.get('username')
|
|
||||||
user = request.user
|
user = request.user
|
||||||
|
|
||||||
form = forms.EditAccountForm(request.POST)
|
form = forms.EditAccountForm(request.POST)
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
from sqlalchemy.orm import sessionmaker
|
from sqlalchemy.orm import sessionmaker
|
||||||
|
|
||||||
from mediagoblin.db.sql.open import setup_connection_and_db_from_config
|
from mediagoblin.db.sql.open import setup_connection_and_db_from_config
|
||||||
from mediagoblin.db.sql.util import (
|
from mediagoblin.db.sql.util import MigrationManager
|
||||||
MigrationManager, assure_migrations_table_setup)
|
|
||||||
from mediagoblin.init import setup_global_and_app_config
|
from mediagoblin.init import setup_global_and_app_config
|
||||||
from mediagoblin.tools.common import import_component
|
from mediagoblin.tools.common import import_component
|
||||||
|
|
||||||
|
@ -61,8 +61,7 @@ def _import_media(db, args):
|
|||||||
args._cache_path['media'])
|
args._cache_path['media'])
|
||||||
|
|
||||||
# TODO: Add import of queue files
|
# TODO: Add import of queue files
|
||||||
queue_cache = BasicFileStorage(
|
queue_cache = BasicFileStorage(args._cache_path['queue'])
|
||||||
args._cache_path['queue'])
|
|
||||||
|
|
||||||
for entry in db.MediaEntry.find():
|
for entry in db.MediaEntry.find():
|
||||||
for name, path in entry.media_files.items():
|
for name, path in entry.media_files.items():
|
||||||
@ -203,8 +202,7 @@ def _export_media(db, args):
|
|||||||
args._cache_path['media'])
|
args._cache_path['media'])
|
||||||
|
|
||||||
# TODO: Add export of queue files
|
# TODO: Add export of queue files
|
||||||
queue_cache = BasicFileStorage(
|
queue_cache = BasicFileStorage(args._cache_path['queue'])
|
||||||
args._cache_path['queue'])
|
|
||||||
|
|
||||||
for entry in db.MediaEntry.find():
|
for entry in db.MediaEntry.find():
|
||||||
for name, path in entry.media_files.items():
|
for name, path in entry.media_files.items():
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import hashlib
|
|
||||||
import random
|
import random
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -81,7 +80,7 @@ class CsrfMeddleware(BaseMeddleware):
|
|||||||
request.environ['CSRF_TOKEN'] = \
|
request.environ['CSRF_TOKEN'] = \
|
||||||
request.cookies[mg_globals.app_config['csrf_cookie_name']]
|
request.cookies[mg_globals.app_config['csrf_cookie_name']]
|
||||||
|
|
||||||
except KeyError, e:
|
except KeyError:
|
||||||
# if it doesn't exist, make a new one
|
# if it doesn't exist, make a new one
|
||||||
request.environ['CSRF_TOKEN'] = self._make_token(request)
|
request.environ['CSRF_TOKEN'] = self._make_token(request)
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ def process_audio(entry):
|
|||||||
webm_audio_tmp.name,
|
webm_audio_tmp.name,
|
||||||
quality=audio_config['quality'])
|
quality=audio_config['quality'])
|
||||||
|
|
||||||
data = transcoder.discover(webm_audio_tmp.name)
|
transcoder.discover(webm_audio_tmp.name)
|
||||||
|
|
||||||
_log.debug('Saving medium...')
|
_log.debug('Saving medium...')
|
||||||
mgg.public_store.get_file(webm_audio_filepath, 'wb').write(
|
mgg.public_store.get_file(webm_audio_filepath, 'wb').write(
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
|
||||||
import shutil
|
import shutil
|
||||||
import urlparse
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
@ -73,8 +73,7 @@ class CloudFilesStorage(StorageInterface):
|
|||||||
|
|
||||||
def file_exists(self, filepath):
|
def file_exists(self, filepath):
|
||||||
try:
|
try:
|
||||||
object = self.container.get_object(
|
self.container.get_object( self._resolve_filepath(filepath))
|
||||||
self._resolve_filepath(filepath))
|
|
||||||
return True
|
return True
|
||||||
except cloudfiles.errors.NoSuchObject:
|
except cloudfiles.errors.NoSuchObject:
|
||||||
return False
|
return False
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
from mediagoblin.storage import StorageInterface, clean_listy_filepath
|
from mediagoblin.storage import StorageInterface, clean_listy_filepath
|
||||||
|
|
||||||
|
|
||||||
|
class MountError(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class MountStorage(StorageInterface):
|
class MountStorage(StorageInterface):
|
||||||
"""
|
"""
|
||||||
Experimental "Mount" virtual Storage Interface
|
Experimental "Mount" virtual Storage Interface
|
||||||
@ -105,7 +109,7 @@ class MountStorage(StorageInterface):
|
|||||||
def resolve_to_backend(self, filepath):
|
def resolve_to_backend(self, filepath):
|
||||||
backend, filepath = self._resolve_to_backend(filepath)
|
backend, filepath = self._resolve_to_backend(filepath)
|
||||||
if backend is None:
|
if backend is None:
|
||||||
raise Error("Path not mounted")
|
raise MountError("Path not mounted")
|
||||||
return backend, filepath
|
return backend, filepath
|
||||||
|
|
||||||
def __repr__(self, table=None, indent=[]):
|
def __repr__(self, table=None, indent=[]):
|
||||||
|
@ -14,11 +14,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import urlparse
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
from nose.tools import assert_equal
|
|
||||||
|
|
||||||
from mediagoblin.tests.tools import setup_fresh_app
|
from mediagoblin.tests.tools import setup_fresh_app
|
||||||
from mediagoblin import mg_globals
|
from mediagoblin import mg_globals
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from nose.tools import assert_equal, assert_true, assert_false
|
from nose.tools import assert_equal
|
||||||
|
|
||||||
from mediagoblin import processing
|
from mediagoblin import processing
|
||||||
|
|
||||||
|
@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
import urlparse
|
import urlparse
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
|
|
||||||
from nose.tools import assert_equal, assert_true, assert_false
|
from nose.tools import assert_equal, assert_true
|
||||||
from pkg_resources import resource_filename
|
from pkg_resources import resource_filename
|
||||||
|
|
||||||
from mediagoblin.tests.tools import get_test_app, \
|
from mediagoblin.tests.tools import get_test_app, \
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from mediagoblin.tests.tools import setup_fresh_app
|
from mediagoblin.tests.tools import setup_fresh_app
|
||||||
from mediagoblin import mg_globals
|
|
||||||
from mediagoblin.tools import text
|
from mediagoblin.tools import text
|
||||||
|
|
||||||
@setup_fresh_app
|
@setup_fresh_app
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from nose.tools import assert_raises
|
|
||||||
|
|
||||||
from mediagoblin import workbench
|
from mediagoblin import workbench
|
||||||
from mediagoblin.tests.test_storage import get_tmp_filestorage
|
from mediagoblin.tests.test_storage import get_tmp_filestorage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user