Remove unused imports & other small things.

This commit is contained in:
voussoir 2020-02-20 22:44:56 -08:00
parent b846be75b0
commit 9d620b4b97
14 changed files with 4 additions and 24 deletions

View file

@ -3,7 +3,6 @@ This file provides data and objects that do not change throughout the runtime.
'''
import converter
import logging
import shutil
import string
import traceback
import warnings

View file

@ -1195,7 +1195,6 @@ class Tag(ObjectBase, GroupableMixin):
# Migrate the old tag's synonyms to the new one
# UPDATE is safe for this operation because there is no chance of duplicates.
my_synonyms = self.get_synonyms()
data = {
'mastername': (self.name, mastertag.name),
}

View file

@ -474,7 +474,6 @@ class PDBPhotoMixin:
)
(tag_musts, tag_mays, tag_forbids, tag_expression) = tags_fixed
if tag_expression:
frozen_children = self.get_cached_frozen_children()
tag_expression_tree = searchhelpers.tag_expression_tree_builder(

View file

@ -1,10 +1,8 @@
import flask; from flask import request
import functools
import hashlib
import time
from voussoirkit import cacheclass
from voussoirkit import pathclass
import etiquette

View file

@ -1,5 +1,4 @@
import flask; from flask import request
import os
import mimetypes
import traceback

View file

@ -1,7 +1,5 @@
import flask; from flask import request
import os
import urllib.parse
import zipstream
import etiquette

View file

@ -1,5 +1,4 @@
import flask; from flask import request
import json
import traceback
import urllib.parse

View file

@ -1,5 +1,4 @@
import flask; from flask import request
import json
import etiquette
@ -76,7 +75,7 @@ def get_all_tag_names():
all_tags = common.P.get_all_tag_names()
all_synonyms = common.P.get_all_synonyms()
response = {'tags': all_tags, 'synonyms': all_synonyms}
return json.dumps(response)
return jsonify.make_json_response(response)
@site.route('/tag/<specific_tag_name>')
@site.route('/tags')
@ -141,7 +140,7 @@ def post_tag_create():
name = request.form['name']
description = request.form.get('description', None)
tag = P.new_tag(name, description, author=session_manager.get(request).user, commit=True)
tag = common.P.new_tag(name, description, author=session_manager.get(request).user, commit=True)
response = etiquette.jsonify.tag(tag)
return jsonify.make_json_response(response)

View file

@ -3,8 +3,6 @@ import jinja2.filters
import voussoirkit.bytestring
import etiquette
def bytestring(x):
try:

View file

@ -1,7 +1,5 @@
import flask; from flask import request
import functools
import math
import os
import werkzeug.wrappers
from voussoirkit import cacheclass

View file

@ -4,7 +4,6 @@ This file is the WSGI entrypoint for remote / production use.
If you are using Gunicorn, for example:
gunicorn etiquette_flask_entrypoint:site --bind "0.0.0.0:PORT" --access-logfile "-"
'''
import sys
import werkzeug.contrib.fixers
import backend

View file

@ -1,5 +1,4 @@
import json
import os
import unittest
import random
import requests

View file

@ -6,7 +6,6 @@ logging.getLogger().addHandler(handler)
import argparse
import code
import os
import sys
import traceback
@ -23,7 +22,7 @@ def easytagger():
i = i.split('?')[1] or None
try:
etiquette.tag_export.stdout([P.get_tag(name=i)])
except:
except Exception:
traceback.print_exc()
else:
P.easybake(i)
@ -42,7 +41,6 @@ def erepl_argparse(args):
exec(args.exec_statement)
P.commit()
else:
import code
while True:
try:
code.interact(banner='', local=dict(globals(), **locals()))

View file

@ -1,6 +1,4 @@
import argparse
import os
import sqlite3
import sys
import etiquette