diff --git a/quit/conf.py b/quit/conf.py index 6a29cd41..32da6400 100644 --- a/quit/conf.py +++ b/quit/conf.py @@ -1,19 +1,16 @@ import logging -import os -from pygit2 import Repository, GIT_OBJ_BLOB, GIT_OBJ_TREE -from os import walk -from os.path import join, isfile, relpath -from quit.exceptions import MissingConfigurationError, InvalidConfigurationError +from pygit2 import GIT_OBJ_BLOB, GIT_OBJ_TREE +from os.path import join, isfile +from quit.exceptions import InvalidConfigurationError from quit.exceptions import UnknownConfigurationError from quit.helpers import isAbsoluteUri -from rdflib import Graph, ConjunctiveGraph, Literal, Namespace, URIRef, BNode +from rdflib import Graph, Literal, Namespace, URIRef from rdflib.plugins.parsers import notation3 from rdflib.namespace import RDF, NamespaceManager from rdflib.util import guess_format -from urllib.parse import quote, urlencode +from urllib.parse import quote from rdflib.term import _is_valid_uri -from uritools import urisplit logger = logging.getLogger('quit.conf') diff --git a/quit/core.py b/quit/core.py index e6de4ef6..583ffd48 100644 --- a/quit/core.py +++ b/quit/core.py @@ -4,11 +4,6 @@ from copy import copy -from pygit2 import GIT_MERGE_ANALYSIS_UP_TO_DATE -from pygit2 import GIT_MERGE_ANALYSIS_FASTFORWARD -from pygit2 import GIT_MERGE_ANALYSIS_NORMAL -from pygit2 import GIT_SORT_REVERSE, GIT_RESET_HARD, GIT_STATUS_CURRENT - from rdflib import Graph, ConjunctiveGraph, BNode, Literal, URIRef import re diff --git a/quit/git.py b/quit/git.py index 6775559e..00d051d0 100644 --- a/quit/git.py +++ b/quit/git.py @@ -3,7 +3,7 @@ import re import logging -from pygit2._pygit2 import GitError, Oid +from pygit2._pygit2 import GitError from os.path import expanduser, join from quit.exceptions import RepositoryNotFound, RevisionNotFound, NodeNotFound, RemoteNotFound from quit.exceptions import QuitGitRefNotFound, QuitGitRepoError, QuitGitPushError @@ -399,7 +399,7 @@ def merge(self, target=None, branch=None, method=None): if target_ref.type == pygit2.GIT_REF_SYMBOLIC: target_ref = target_ref.resolve() target_ref.set_target(self.lookup(branch)) - except KeyError as e: + except KeyError: # If HEAD is unborn if target_ref.type == pygit2.GIT_REF_SYMBOLIC: target = target_ref.target diff --git a/quit/graphs.py b/quit/graphs.py index f74c83ae..c685fda7 100644 --- a/quit/graphs.py +++ b/quit/graphs.py @@ -1,5 +1,4 @@ import functools -import logging from itertools import chain from rdflib import Graph, ConjunctiveGraph, URIRef from rdflib.graph import ModificationException diff --git a/quit/helpers.py b/quit/helpers.py index 9d5cde01..2611a641 100644 --- a/quit/helpers.py +++ b/quit/helpers.py @@ -286,7 +286,6 @@ def parse_sparql_request(request): type = None default_graph = [] named_graph = [] - accept_header = None if request.method == "GET": default_graph = request.args.getlist('default-graph-uri') diff --git a/quit/merge.py b/quit/merge.py index b76973b6..a0e52d62 100644 --- a/quit/merge.py +++ b/quit/merge.py @@ -1,4 +1,3 @@ -import os import pygit2 import rdflib import logging diff --git a/quit/plugins/serializers/results/htmlresults.py b/quit/plugins/serializers/results/htmlresults.py index 40ff16ff..72cee999 100644 --- a/quit/plugins/serializers/results/htmlresults.py +++ b/quit/plugins/serializers/results/htmlresults.py @@ -56,7 +56,7 @@ def qname(ctx, term): else: label = nm.compute_qname(term, False) return u'%s:%s' % (label[0], label[2]) - except Exception as e: + except Exception: return term diff --git a/quit/utils.py b/quit/utils.py index 39018c0f..dd42e961 100644 --- a/quit/utils.py +++ b/quit/utils.py @@ -1,5 +1,4 @@ from __future__ import with_statement -from flask import Response import os import contextlib import signal @@ -159,7 +158,6 @@ def handler(signum, frame): # =============================================================== import unittest - import os class TestOnExit(unittest.TestCase): diff --git a/quit/web/app.py b/quit/web/app.py index 392dd35e..386cdad8 100644 --- a/quit/web/app.py +++ b/quit/web/app.py @@ -205,7 +205,7 @@ def qname(ctx, t): config = ctx.get('config') link = config['quit'].store.store.compute_qname(t, False) return u'%s:%s' % (link[0], link[2]) - except Exception as e: + except Exception: return t if isinstance(t, rdflib.URIRef): diff --git a/quit/web/extras/commits_graph.py b/quit/web/extras/commits_graph.py index a086c6ef..4c35cb16 100644 --- a/quit/web/extras/commits_graph.py +++ b/quit/web/extras/commits_graph.py @@ -9,13 +9,6 @@ import json -from itertools import islice -from pygit2 import ( - GIT_SORT_TIME, - GIT_SORT_TOPOLOGICAL, - GIT_SORT_REVERSE -) - class CommitGraph(object): def __init__(self, sha, parents): diff --git a/quit/web/modules/debug.py b/quit/web/modules/debug.py index bda96554..fb64a5f7 100644 --- a/quit/web/modules/debug.py +++ b/quit/web/modules/debug.py @@ -1,8 +1,7 @@ -import sys import traceback from werkzeug.http import parse_accept_header -from flask import Blueprint, flash, redirect, request, url_for, current_app, make_response, Markup +from flask import Blueprint, request, current_app, make_response from quit.conf import Feature from quit.web.app import render_template, feature_required diff --git a/quit/web/modules/endpoint.py b/quit/web/modules/endpoint.py index 9783cb8c..9bd3e881 100644 --- a/quit/web/modules/endpoint.py +++ b/quit/web/modules/endpoint.py @@ -120,7 +120,7 @@ def sparql(branch_or_ref): tmp_branch.delete() response = make_response('success', 200) target_branch = branch_or_ref - except QuitMergeConflict as e: + except QuitMergeConflict: response = make_response('merge failed', 400) else: response = make_response('branched', 200) diff --git a/setup.py b/setup.py index 875a79a7..bd573559 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,6 @@ Git. """ from setuptools import setup -import os setup( name='quit-store',