Remove unused imports throughout the code base
Thanks to autoflake.
This commit is contained in:
parent
c0b225e529
commit
e54f1192ba
@ -14,8 +14,8 @@ from gaphor.UML.properties import umlproperty
|
||||
from gaphor.UML.elementdispatcher import EventWatcher
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gaphor.UML.elementfactory import ElementFactory
|
||||
from gaphor.UML.presentation import Presentation
|
||||
from gaphor.UML.elementfactory import ElementFactory # noqa
|
||||
from gaphor.UML.presentation import Presentation # noqa
|
||||
|
||||
|
||||
class UnlinkEvent:
|
||||
|
@ -12,7 +12,7 @@ from gaphor.UML.event import ElementCreated, ElementDeleted, ModelFlushed, Model
|
||||
from gaphor.abc import Service
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gaphor.services.eventmanager import EventManager
|
||||
from gaphor.services.eventmanager import EventManager # noqa
|
||||
|
||||
|
||||
T = TypeVar("T", bound=Element)
|
||||
|
@ -7,7 +7,7 @@ from gaphor.UML.properties import umlproperty, association
|
||||
from gaphor.UML.element import Element
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gaphas.canvas import Canvas
|
||||
from gaphas.canvas import Canvas # noqa
|
||||
|
||||
S = TypeVar("S", bound=Element)
|
||||
|
||||
|
@ -4,7 +4,6 @@ Formatting of UML model elements into text tests.
|
||||
|
||||
import pytest
|
||||
|
||||
from gaphor.application import Application
|
||||
from gaphor.services.eventmanager import EventManager
|
||||
from gaphor.UML.elementfactory import ElementFactory
|
||||
from gaphor.UML.umlfmt import format
|
||||
|
@ -3,10 +3,8 @@ Parsing of UML model elements from string tests.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
from gaphor.application import Application
|
||||
from gaphor.services.eventmanager import EventManager
|
||||
from gaphor.UML.elementfactory import ElementFactory
|
||||
from gaphor.UML.umllex import parse
|
||||
from gaphor.UML.umllex import attribute_pat, operation_pat, parameter_pat
|
||||
from gaphor import UML
|
||||
|
||||
|
@ -5,8 +5,6 @@
|
||||
from typing import Optional, Sequence, get_type_hints
|
||||
import platform
|
||||
|
||||
from gaphor.application import Application
|
||||
|
||||
|
||||
_primary = "⌘" if platform.system() == "Darwin" else "Ctrl"
|
||||
|
||||
|
@ -15,7 +15,7 @@ from gaphor import UML
|
||||
from gaphor.UML.modelfactory import stereotypes_str
|
||||
from gaphor.diagram.presentation import ElementPresentation, Named
|
||||
from gaphor.diagram.support import represents
|
||||
from gaphor.diagram.shapes import Box, IconBox, EditableText, Text, draw_border
|
||||
from gaphor.diagram.shapes import Box, EditableText, IconBox, Text
|
||||
|
||||
|
||||
DEFAULT_JOIN_SPEC = "and"
|
||||
|
@ -8,7 +8,6 @@ Contains also implementation to split flows using activity edge connectors.
|
||||
from gaphor import UML
|
||||
from gaphor.UML.modelfactory import stereotypes_str
|
||||
from gaphor.diagram.presentation import LinePresentation
|
||||
from gaphor.diagram.text import TextAlign, VerticalAlign
|
||||
from gaphor.diagram.support import represents
|
||||
from gaphor.diagram.shapes import Box, Text, EditableText, draw_arrow_tail
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
Object node item.
|
||||
"""
|
||||
|
||||
import itertools
|
||||
import ast
|
||||
|
||||
from gaphas.state import observed, reversible_property
|
||||
|
@ -14,7 +14,7 @@ from gaphor.UML.modelfactory import stereotypes_str
|
||||
from gaphor.diagram.presentation import ElementPresentation, Named
|
||||
from gaphor.diagram.support import represents
|
||||
from gaphor.diagram.text import VerticalAlign
|
||||
from gaphor.diagram.shapes import Box, EditableText, Text, draw_highlight
|
||||
from gaphor.diagram.shapes import Box, Text, draw_highlight
|
||||
|
||||
|
||||
@represents(UML.ActivityPartition)
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
from gi.repository import Gtk
|
||||
|
||||
from gaphor import UML
|
||||
|
||||
from gaphor.core import _, transactional
|
||||
from gaphor.diagram.propertypages import PropertyPages, NamedItemPropertyPage
|
||||
|
@ -10,7 +10,6 @@ from gaphor.diagram.presentation import Named, Classified
|
||||
from gaphor.diagram.classes.dependency import DependencyItem
|
||||
from gaphor.diagram.classes.implementation import ImplementationItem
|
||||
from gaphor.diagram.classes.generalization import GeneralizationItem
|
||||
from gaphor.diagram.classes.interface import InterfaceItem
|
||||
from gaphor.diagram.classes.association import AssociationItem
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ import ast
|
||||
from gaphor import UML
|
||||
from gaphor.UML.modelfactory import stereotypes_str
|
||||
from gaphor.diagram.presentation import LinePresentation
|
||||
from gaphor.diagram.shapes import Box, Text
|
||||
from gaphor.diagram.shapes import Text
|
||||
from gaphor.diagram.support import represents
|
||||
from gaphor.diagram.classes.interface import InterfacePort
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
Generalization --
|
||||
"""
|
||||
|
||||
from gi.repository import GObject
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.UML.modelfactory import stereotypes_str
|
||||
|
@ -5,7 +5,7 @@ Implementation of interface.
|
||||
from gaphor import UML
|
||||
from gaphor.UML.modelfactory import stereotypes_str
|
||||
from gaphor.diagram.presentation import LinePresentation
|
||||
from gaphor.diagram.shapes import Box, Text
|
||||
from gaphor.diagram.shapes import Text
|
||||
from gaphor.diagram.support import represents
|
||||
from gaphor.diagram.classes.interface import InterfacePort
|
||||
|
||||
|
@ -6,7 +6,6 @@ to folded interface, see `gaphor.diagram.classes.interface` documentation
|
||||
for details.
|
||||
"""
|
||||
|
||||
from gaphor import UML
|
||||
|
||||
from gaphor.diagram.connectors import IConnect
|
||||
from gaphor.diagram.classes.classconnect import DependencyConnect, ImplementationConnect
|
||||
|
@ -4,10 +4,7 @@ Unnit tests for AssociationItem.
|
||||
|
||||
from gaphor.tests import TestCase
|
||||
from gaphor import UML
|
||||
from gaphor.diagram.usecases.usecase import UseCaseItem
|
||||
from gaphor.diagram.usecases.actor import ActorItem
|
||||
from gaphor.diagram.classes.klass import ClassItem
|
||||
from gaphor.diagram.classes.interface import InterfaceItem
|
||||
from gaphor.diagram.classes.association import AssociationItem
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@ from gi.repository import Gtk
|
||||
|
||||
from gaphor.tests import TestCase
|
||||
from gaphor import UML
|
||||
from gaphor.diagram.classes import ClassItem, AssociationItem
|
||||
from gaphor.diagram.classes import ClassItem
|
||||
from gaphor.diagram.classes.classespropertypages import ClassAttributes
|
||||
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
from gi.repository import Gtk
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.core import _, transactional
|
||||
from gaphor.diagram.propertypages import PropertyPages, NamedItemPropertyPage
|
||||
from gaphor.diagram.components import ComponentItem
|
||||
|
@ -6,7 +6,6 @@ from functools import singledispatch
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.diagram.presentation import Named, Classified
|
||||
from gaphor.misc.rattr import rgetattr, rsetattr
|
||||
|
||||
|
||||
@singledispatch
|
||||
|
@ -2,13 +2,12 @@
|
||||
CommentItem diagram item
|
||||
"""
|
||||
|
||||
from gaphas.item import NW
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.diagram.presentation import ElementPresentation
|
||||
|
||||
from gaphor.diagram.shapes import Box, Text
|
||||
from gaphor.diagram.text import TextAlign, VerticalAlign, text_size
|
||||
from gaphor.diagram.text import TextAlign, VerticalAlign
|
||||
from gaphor.diagram.support import represents
|
||||
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
"""Unit tests for simple items."""
|
||||
|
||||
from gaphor.tests import TestCase
|
||||
from gaphor import UML
|
||||
from gaphor.diagram.general.simpleitem import Line, Box, Ellipse
|
||||
from gaphor.diagram.general.simpleitem import Ellipse, Line
|
||||
from gaphas import View
|
||||
|
||||
|
||||
|
@ -20,7 +20,6 @@ from __future__ import annotations
|
||||
from typing import Type
|
||||
import abc
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.misc.generic.multidispatch import multidispatch, FunctionDispatcher
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ lifeline.
|
||||
from gaphas.item import SW, SE
|
||||
from gaphas.connector import Handle, LinePort
|
||||
from gaphas.solver import STRONG
|
||||
from gaphas.geometry import distance_line_point, Rectangle
|
||||
from gaphas.geometry import distance_line_point
|
||||
from gaphas.constraint import (
|
||||
LessThanConstraint,
|
||||
EqualsConstraint,
|
||||
|
@ -48,7 +48,6 @@ See also ``lifeline`` module documentation.
|
||||
|
||||
from typing import List
|
||||
from math import pi, atan2
|
||||
from gaphas.util import path_ellipse
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.UML.modelfactory import stereotypes_str
|
||||
|
@ -2,7 +2,7 @@
|
||||
Stereotype property page.
|
||||
"""
|
||||
|
||||
from gi.repository import GObject, Gtk
|
||||
from gi.repository import Gtk
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.core import _, transactional
|
||||
|
@ -1,6 +1,5 @@
|
||||
from gaphor.tests import TestCase
|
||||
from gaphor.diagram.profiles.metaclasspropertypage import MetaclassNamePropertyPage
|
||||
from gaphor.diagram.classes import ClassItem
|
||||
from gaphor import UML
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
@ -8,7 +8,6 @@ from gaphas.util import path_ellipse
|
||||
from gaphor.diagram.states.state import VertexItem
|
||||
from gaphor.diagram.presentation import ElementPresentation
|
||||
from gaphor.diagram.shapes import Box, IconBox, EditableText, Text
|
||||
from gaphor.diagram.text import TextAlign, VerticalAlign
|
||||
from gaphor.diagram.support import represents
|
||||
|
||||
|
||||
|
@ -10,7 +10,6 @@ from gaphas.util import path_ellipse
|
||||
from gaphor.diagram.states.state import VertexItem
|
||||
from gaphor.diagram.presentation import ElementPresentation
|
||||
from gaphor.diagram.shapes import Box, IconBox, EditableText, Text
|
||||
from gaphor.diagram.text import TextAlign, VerticalAlign
|
||||
from gaphor.diagram.support import represents
|
||||
|
||||
|
||||
|
@ -3,7 +3,6 @@ import pytest
|
||||
import cairo
|
||||
|
||||
from gaphor.diagram.shapes import Box, IconBox, Text
|
||||
from gaphas.canvas import Context
|
||||
from gaphas.geometry import Rectangle
|
||||
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
import pytest
|
||||
import cairo
|
||||
|
||||
from gaphas.canvas import instant_cairo_context
|
||||
import gaphor.diagram.text
|
||||
from gaphor.diagram.text import (
|
||||
text_size,
|
||||
text_point_at_line,
|
||||
|
@ -8,7 +8,6 @@ from enum import Enum
|
||||
import cairo
|
||||
from gi.repository import GLib, Pango, PangoCairo
|
||||
|
||||
from gaphas.geometry import Rectangle
|
||||
from gaphas.freehand import FreeHandCairoContext
|
||||
from gaphas.painter import CairoBoundingBoxContext
|
||||
|
||||
|
@ -5,7 +5,7 @@ Gaphor is using color values from 0 to 1 (cairo standard), so that required some
|
||||
on the color widget. The standard format is `(red, green, blue, alpha)`.
|
||||
"""
|
||||
|
||||
from gi.repository import GObject, Gdk, Gtk
|
||||
from gi.repository import Gdk, Gtk
|
||||
|
||||
|
||||
class ColorButton(Gtk.ColorButton):
|
||||
|
@ -10,7 +10,6 @@ from gaphas.view import Context, View
|
||||
|
||||
from gaphor.core import _, action
|
||||
from gaphor.abc import Service, ActionProvider
|
||||
from gaphor.ui.abc import UIComponent
|
||||
from gaphor.ui.filedialog import FileDialog
|
||||
from gaphor.ui.questiondialog import QuestionDialog
|
||||
|
||||
|
@ -7,7 +7,7 @@ from gi.repository import Gtk
|
||||
|
||||
|
||||
from gaphor import __version__
|
||||
from gaphor.core import _, action
|
||||
from gaphor.core import action
|
||||
from gaphor.abc import Service, ActionProvider
|
||||
|
||||
|
||||
|
@ -2,7 +2,6 @@ from gaphor import UML
|
||||
from gaphor.diagram.general import CommentItem
|
||||
from gaphor.diagram.classes import AssociationItem, ClassItem
|
||||
from gaphor.services.copyservice import CopyService
|
||||
from gaphor.application import Application
|
||||
from gaphor.tests.testcase import TestCase
|
||||
from gaphor.storage.verify import orphan_references
|
||||
|
||||
|
@ -18,9 +18,8 @@ import io
|
||||
import gaphas
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor import diagram
|
||||
from gaphor.UML.collection import collection
|
||||
from gaphor.application import Application, NotInitializedError
|
||||
from gaphor.application import Application
|
||||
from gaphor.i18n import _
|
||||
from gaphor.storage import parser, diagramitems
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
import pytest
|
||||
|
||||
from gaphor.action import action
|
||||
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from gaphor.core import Application, event_handler
|
||||
from gaphor.transaction import Transaction, transactional, TransactionError
|
||||
from gaphor.core import event_handler
|
||||
from gaphor.transaction import Transaction, TransactionError
|
||||
from gaphor.event import TransactionBegin, TransactionCommit, TransactionRollback
|
||||
from gaphor.services.eventmanager import EventManager
|
||||
|
||||
|
@ -18,7 +18,7 @@ from gaphor.diagram.connectors import IConnect
|
||||
from gaphor.diagram.grouping import Group
|
||||
|
||||
# For DiagramItemConnector aspect:
|
||||
import gaphor.ui.diagramtools
|
||||
import gaphor.ui.diagramtools # noqa
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import gaphor
|
||||
from gaphor.storage import storage
|
||||
import gaphor.UML as UML
|
||||
from gaphor.services.eventmanager import EventManager
|
||||
from gaphor.application import Application
|
||||
|
||||
from gaphas.painter import Context, ItemPainter
|
||||
|
@ -2,7 +2,6 @@ from typing import NamedTuple
|
||||
|
||||
from gi.repository import GLib, Gio, Gtk
|
||||
from gaphor.abc import ActionProvider
|
||||
from gaphor.action import action
|
||||
|
||||
|
||||
class ActionGroup(NamedTuple):
|
||||
|
@ -7,8 +7,6 @@ from xml.etree.ElementTree import fromstring
|
||||
|
||||
from gi.repository import Gtk
|
||||
|
||||
from gaphor.core import _
|
||||
|
||||
|
||||
widget_factory: Dict[str, Callable] = {}
|
||||
|
||||
|
@ -10,9 +10,9 @@ from pathlib import Path
|
||||
import importlib.resources
|
||||
from gi.repository import Gio, Gdk, Gtk, GLib
|
||||
|
||||
from gaphor import UML, Application
|
||||
from gaphor import UML
|
||||
from gaphor.UML.event import ModelReady
|
||||
from gaphor.core import _, event_handler, action, transactional
|
||||
from gaphor.core import _, event_handler
|
||||
from gaphor.abc import Service, ActionProvider
|
||||
from gaphor.event import ActionEnabled
|
||||
from gaphor.UML.event import AttributeUpdated, ModelFlushed
|
||||
@ -29,8 +29,6 @@ from gaphor.ui.event import (
|
||||
WindowClosed,
|
||||
)
|
||||
from gaphor.ui.layout import deserialize
|
||||
from gaphor.ui.namespace import Namespace
|
||||
from gaphor.ui.toolbox import Toolbox
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -1,5 +1,5 @@
|
||||
import importlib
|
||||
from gi.repository import GLib, Gio, Gtk
|
||||
from gi.repository import Gtk
|
||||
|
||||
from gaphor.abc import Service, ActionProvider
|
||||
from gaphor.core import action
|
||||
|
@ -2,7 +2,7 @@ import pytest
|
||||
|
||||
from gaphor.services.eventmanager import EventManager
|
||||
from gaphor.UML.elementfactory import ElementFactory
|
||||
from gaphor.ui.mainwindow import MainWindow, Diagrams
|
||||
from gaphor.ui.mainwindow import Diagrams
|
||||
from gaphor.ui.elementeditor import ElementEditor
|
||||
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
import pytest
|
||||
|
||||
from gaphor.core import action
|
||||
from gaphor.ui.menufragment import MenuFragment
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
import pytest
|
||||
|
||||
from gi.repository import Gtk
|
||||
from gaphor.ui.preferences import Preferences
|
||||
|
||||
|
@ -5,9 +5,9 @@ Toolbox.
|
||||
|
||||
import logging
|
||||
|
||||
from gi.repository import GLib, GObject, Gdk, Gtk
|
||||
from gi.repository import GLib, Gdk, Gtk
|
||||
|
||||
from gaphor.core import _, event_handler
|
||||
from gaphor.core import _
|
||||
from gaphor.abc import ActionProvider
|
||||
from gaphor.ui.abc import UIComponent
|
||||
from gaphor.ui.diagramtoolbox import TOOLBOX_ACTIONS
|
||||
|
@ -68,8 +68,8 @@ gaphorconvert = 'gaphor.tools.gaphorconvert:main'
|
||||
"copy" = "gaphor.services.copyservice:CopyService"
|
||||
"sanitizer" = "gaphor.services.sanitizerservice:SanitizerService"
|
||||
"help" = "gaphor.services.helpservice:HelpService"
|
||||
"namespace" = "gaphor.ui.mainwindow:Namespace"
|
||||
"toolbox" = "gaphor.ui.mainwindow:Toolbox"
|
||||
"namespace" = "gaphor.ui.namespace:Namespace"
|
||||
"toolbox" = "gaphor.ui.toolbox:Toolbox"
|
||||
"diagrams" = "gaphor.ui.mainwindow:Diagrams"
|
||||
"consolewindow" = "gaphor.ui.consolewindow:ConsoleWindow"
|
||||
"elementeditor" = "gaphor.ui.elementeditor:ElementEditor"
|
||||
|
4
setup.py
4
setup.py
@ -117,8 +117,8 @@ setup(
|
||||
"copy = gaphor.services.copyservice:CopyService",
|
||||
"sanitizer = gaphor.services.sanitizerservice:SanitizerService",
|
||||
"help = gaphor.services.helpservice:HelpService",
|
||||
"namespace = gaphor.ui.mainwindow:Namespace",
|
||||
"toolbox = gaphor.ui.mainwindow:Toolbox",
|
||||
"namespace = gaphor.ui.namespace:Namespace",
|
||||
"toolbox = gaphor.ui.toolbox:Toolbox",
|
||||
"diagrams = gaphor.ui.mainwindow:Diagrams",
|
||||
"consolewindow = gaphor.ui.consolewindow:ConsoleWindow",
|
||||
"elementeditor = gaphor.ui.elementeditor:ElementEditor",
|
||||
|
@ -1,7 +1,6 @@
|
||||
from gaphor.tests import TestCase
|
||||
from gaphor import UML
|
||||
from gaphor.diagram.classes import AssociationItem, ClassItem
|
||||
from gaphas.aspect import ConnectionSink
|
||||
|
||||
|
||||
class GaphasTest(TestCase):
|
||||
|
@ -337,7 +337,6 @@ def getFilesForName(name):
|
||||
""" Get a list of module files for a filename, a module or package name,
|
||||
or a directory.
|
||||
"""
|
||||
import imp
|
||||
|
||||
if not os.path.exists(name):
|
||||
# check for glob chars
|
||||
|
Loading…
x
Reference in New Issue
Block a user