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 converter
import logging import logging
import shutil
import string import string
import traceback import traceback
import warnings import warnings

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,4 @@
import flask; from flask import request import flask; from flask import request
import json
import etiquette import etiquette
@ -76,7 +75,7 @@ def get_all_tag_names():
all_tags = common.P.get_all_tag_names() all_tags = common.P.get_all_tag_names()
all_synonyms = common.P.get_all_synonyms() all_synonyms = common.P.get_all_synonyms()
response = {'tags': all_tags, 'synonyms': 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('/tag/<specific_tag_name>')
@site.route('/tags') @site.route('/tags')
@ -141,7 +140,7 @@ def post_tag_create():
name = request.form['name'] name = request.form['name']
description = request.form.get('description', None) 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) response = etiquette.jsonify.tag(tag)
return jsonify.make_json_response(response) return jsonify.make_json_response(response)
@ -175,5 +174,5 @@ def post_tag_remove_synonym(tagname):
master_tag = common.P_tag(tagname) master_tag = common.P_tag(tagname)
master_tag.remove_synonym(syn_name, commit=True) master_tag.remove_synonym(syn_name, commit=True)
response = {'action':'delete_synonym', 'synonym': syn_name} response = {'action': 'delete_synonym', 'synonym': syn_name}
return jsonify.make_json_response(response) return jsonify.make_json_response(response)

View file

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

View file

@ -1,7 +1,5 @@
import flask; from flask import request import flask; from flask import request
import functools import functools
import math
import os
import werkzeug.wrappers import werkzeug.wrappers
from voussoirkit import cacheclass 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: If you are using Gunicorn, for example:
gunicorn etiquette_flask_entrypoint:site --bind "0.0.0.0:PORT" --access-logfile "-" gunicorn etiquette_flask_entrypoint:site --bind "0.0.0.0:PORT" --access-logfile "-"
''' '''
import sys
import werkzeug.contrib.fixers import werkzeug.contrib.fixers
import backend import backend

View file

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

View file

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

View file

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