Remove futurize dependency, drop support for Python 2

Signed-off-by: Dan Yeaw <dan@yeaw.me>
This commit is contained in:
Dan Yeaw 2019-02-23 22:06:02 -05:00
parent 420f18b9a4
commit f55e582299
No known key found for this signature in database
GPG Key ID: 77A923EF537B61A4
114 changed files with 59 additions and 358 deletions

View File

@ -8,15 +8,12 @@ stages:
jobs:
include:
- python: 2.7
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.7.2
env: PYTEST_ADDOPTS="--doctest-modules"
sudo: true
- stage: lint
python: 3.7
python: 3.7.2
before_install: skip
install:
- pip install pre-commit

View File

@ -4,8 +4,6 @@
with Gaphor.
"""
from __future__ import print_function
import sys
import optparse

View File

@ -2,8 +2,6 @@
1:n and n:m relations in the data model are saved using a collection.
"""
from builtins import object
from builtins import str
import inspect
from gaphor.UML.event import AssociationChangeEvent

View File

@ -5,8 +5,6 @@ representation of a UML diagram. Diagrams can be visualized and edited.
The DiagramCanvas class extends the gaphas.Canvas class.
"""
from builtins import str
from builtins import filter
import uuid
import gaphas

View File

@ -8,9 +8,6 @@ __all__ = ["Element"]
import threading
import uuid
from builtins import object
from builtins import str
from gaphor.UML.properties import umlproperty

View File

@ -3,30 +3,23 @@
Factory for and registration of model elements.
"""
from builtins import object
from builtins import str
from zope.interface import implementer
from zope import component
import uuid
from gaphor.core import inject
from gaphor.misc import odict
from gaphor.interfaces import IService, IEventFilter
from gaphor.UML.interfaces import (
IElementCreateEvent,
IElementDeleteEvent,
IFlushFactoryEvent,
IModelFactoryEvent,
IElementChangeEvent,
IElementEvent,
)
from zope import component
from zope.interface import implementer
from gaphor.UML.diagram import Diagram
from gaphor.UML.element import Element
from gaphor.UML.event import (
ElementCreateEvent,
ElementDeleteEvent,
FlushFactoryEvent,
ModelFactoryEvent,
)
from gaphor.UML.element import Element
from gaphor.UML.diagram import Diagram
from gaphor.UML.interfaces import IElementChangeEvent
from gaphor.core import inject
from gaphor.interfaces import IService, IEventFilter
from gaphor.misc import odict
class ElementFactory(object):

View File

@ -1,7 +1,5 @@
"""The core UML metamodel events."""
from builtins import object
from zope.interface import implementer
from gaphor.UML.interfaces import (

View File

@ -28,10 +28,6 @@ __all__ = ["attribute", "enumeration", "association", "derivedunion", "redefine"
import logging
from builtins import map
from builtins import next
from builtins import object
from builtins import str
from zope import component
from gaphor.UML.collection import collection, collectionlist
@ -44,11 +40,6 @@ from gaphor.UML.interfaces import IAssociationDeleteEvent
from gaphor.UML.interfaces import IAssociationSetEvent, IAssociationAddEvent
from gaphor.UML.interfaces import IElementChangeEvent, IAssociationChangeEvent
# Maintains Python 2 compatibility
try:
from sys import intern
except ImportError:
pass
log = logging.getLogger(__name__)
@ -109,8 +100,8 @@ class attribute(umlproperty):
# TODO: check if lower and upper are actually needed for attributes
def __init__(self, name, type, default=None, lower=0, upper=1):
self.name = intern(name)
self._name = intern("_" + name)
self.name = name
self._name = "_" + name
self.type = type
self.default = default
self.lower = lower
@ -203,8 +194,8 @@ class enumeration(umlproperty):
type = property(lambda s: str)
def __init__(self, name, values, default):
self.name = intern(name)
self._name = intern("_" + name)
self.name = name
self._name = "_" + name
self.values = values
self.default = default
self.lower = 0
@ -262,13 +253,13 @@ class association(umlproperty):
"""
def __init__(self, name, type, lower=0, upper="*", composite=False, opposite=None):
self.name = intern(name)
self._name = intern("_" + name)
self.name = name
self._name = "_" + name
self.type = type
self.lower = lower
self.upper = upper
self.composite = composite
self.opposite = opposite and intern(opposite)
self.opposite = opposite and opposite
self.stub = None
def load(self, obj, value):
@ -460,7 +451,7 @@ class associationstub(umlproperty):
def __init__(self, association):
self.association = association
self._name = intern("_stub_%x" % id(self))
self._name = "_stub_%x" % id(self)
def __get__(self, obj, class_=None):
if obj:
@ -525,8 +516,8 @@ class derived(umlproperty):
"""
def __init__(self, name, type, lower, upper, *subsets):
self.name = intern(name)
self._name = intern("_" + name)
self.name = name
self._name = "_" + name
self.version = 1
self.type = type
self.lower = lower
@ -766,8 +757,8 @@ class redefine(umlproperty):
def __init__(self, decl_class, name, type, original):
self.decl_class = decl_class
self.name = intern(name)
self._name = intern("_" + name)
self.name = name
self._name = "_" + name
self.type = type
self.original = original

View File

@ -2,7 +2,6 @@
Test if the collection's list supports all trickery.
"""
from builtins import str
import unittest
from gaphor.UML.collection import collectionlist

View File

@ -1,5 +1,3 @@
from __future__ import print_function
import unittest
import gaphor.UML as UML

View File

@ -125,14 +125,9 @@ del property_opposite
%%
override Property.isComposite derives Property.aggregation
#Property.isComposite = property(lambda self: self.aggregation == intern('composite'))
#Property.isComposite = property(lambda self: self.aggregation == 'composite')
Property.isComposite = derivedunion('isComposite', bool, 0, 1, Property.aggregation)
# Maintains Python 2 and 3 compatibility
try:
from sys import intern
except ImportError:
pass
Property.isComposite.filter = lambda obj: [obj.aggregation == intern('composite')]
Property.isComposite.filter = lambda obj: [obj.aggregation == 'composite']
%%
override Constraint.context
Constraint.context = derivedunion('context', Namespace, 0, 1)

View File

@ -5,13 +5,10 @@ Formatting of UML elements like attributes, operations, stereotypes, etc.
import io
import re
from future import standard_library
from simplegeneric import generic
from gaphor.UML import uml2 as UML
standard_library.install_aliases()
@generic
def format(el, pattern=None):

View File

@ -6,9 +6,6 @@ The regular expressions are constructed based on a series of
"sub-patterns". This makes it easy to identify the autonomy of an
attribute/operation.
"""
from __future__ import absolute_import
from builtins import map
__all__ = ["parse_property", "parse_operation"]

View File

@ -23,9 +23,6 @@ Support for actions in generic files.
See also gaphor/service/actionmanager.py for the management module.
"""
from __future__ import absolute_import, print_function
from builtins import object
from gaphor.application import Application

View File

@ -2,7 +2,6 @@
Flow item connection adapters tests.
"""
from builtins import object
from gaphor.tests import TestCase
from gaphor import UML
from gaphor.diagram import items

View File

@ -4,9 +4,7 @@ Connector adapters.
To register connectors implemented in this module, it is imported in
gaphor.adapter package.
"""
from __future__ import print_function
from builtins import object
from logging import getLogger
from zope import component

View File

@ -2,19 +2,16 @@
Adapters
"""
from builtins import object
from zope.interface import implementer
from zope import component
from gaphas.item import NW, SE
from gaphas import geometry
from gaphas import constraint
from simplegeneric import generic
from zope.interface import implementer
from gaphor import UML
from gaphor.core import inject
from gaphor.diagram.interfaces import IEditor
from gaphor.diagram import items
from gaphor.diagram.interfaces import IEditor
from gaphor.misc.rattr import rgetattr, rsetattr
from simplegeneric import generic
@generic

View File

@ -14,7 +14,6 @@ instance of an item to be grouped is created. This happens when item
is about to be created. Therefore `AbstractGroup.can_contain` has
to be aware that `AbstractGroup.item` can be null.
"""
from builtins import object
import logging
from zope.interface import implementer

View File

@ -2,7 +2,6 @@
Metaclass item editors.
"""
from builtins import object
from zope import component
from gi.repository import Gtk

View File

@ -1,9 +1,7 @@
"""
Stereotype property page.
"""
from __future__ import print_function
from builtins import object
from zope import component
from gi.repository import Gtk

View File

@ -25,13 +25,7 @@ TODO:
key focuses its associated control.
"""
from __future__ import division
from __future__ import print_function
import math
from builtins import object
from builtins import range
from builtins import zip
from zope import component
import gaphas.item

View File

@ -12,8 +12,6 @@ All important services are present in the application object:
from logging import getLogger
import pkg_resources
from builtins import next
from builtins import object
from zope import component
from gaphor.event import ServiceInitializedEvent, ServiceShutdownEvent

View File

@ -4,13 +4,6 @@ The diagram package contains items (to be drawn on the diagram), tools
diagram).
"""
from builtins import str
import inspect
import gi
gi.require_version("PangoCairo", "1.0")
from gi.repository import GObject
import uuid
from gaphor.diagram.style import Style

View File

@ -1,7 +1,6 @@
"""
Action diagram item.
"""
from __future__ import division
from math import pi

View File

@ -3,9 +3,7 @@ Control flow and object flow implementation.
Contains also implementation to split flows using activity edge connectors.
"""
from __future__ import division
from builtins import object
from math import atan, pi, sin, cos
from gaphor import UML

View File

@ -1,10 +1,7 @@
"""
Activity control nodes.
"""
from __future__ import print_function
from __future__ import division
from builtins import map
import math
from gaphas.util import path_ellipse

View File

@ -1,7 +1,6 @@
"""
Actor item classes.
"""
from __future__ import division
from math import pi

View File

@ -6,27 +6,18 @@ Plan:
- for assocation name and direction tag, use the same trick as is used
for line ends.
"""
from __future__ import division
# TODO: for Association.postload(): in some cases where the association ends
# are connected to the same Class, the head_end property is connected to the
# tail end and visa versa.
# are connected to the same Class, the head_end property is connected to the
# tail end and visa versa.
from builtins import map
from gaphor.diagram.textelement import text_extents, text_multiline
from gaphas.state import reversible_property
from gaphas import Item
from gaphas.geometry import Rectangle, distance_point_point_fast
from gaphas.geometry import distance_rectangle_point, distance_line_point
from gaphas.geometry import distance_rectangle_point
from gaphas.state import reversible_property
from gaphor import UML
from gaphor.diagram.diagramline import NamedLine
# Maintains Python 2 compatibility
try:
from sys import intern
except ImportError:
pass
from gaphor.diagram.textelement import text_extents, text_multiline
class AssociationItem(NamedLine):
@ -183,9 +174,9 @@ class AssociationItem(NamedLine):
# Update line ends using the aggregation and isNavigable values:
if head_subject and tail_subject:
if tail_subject.aggregation == intern("composite"):
if tail_subject.aggregation == "composite":
self.draw_head = self.draw_head_composite
elif tail_subject.aggregation == intern("shared"):
elif tail_subject.aggregation == "shared":
self.draw_head = self.draw_head_shared
elif self._head_end.subject.navigability is True:
self.draw_head = self.draw_head_navigable
@ -194,9 +185,9 @@ class AssociationItem(NamedLine):
else:
self.draw_head = self.draw_head_undefined
if head_subject.aggregation == intern("composite"):
if head_subject.aggregation == "composite":
self.draw_tail = self.draw_tail_composite
elif head_subject.aggregation == intern("shared"):
elif head_subject.aggregation == "shared":
self.draw_tail = self.draw_tail_shared
elif self._tail_end.subject.navigability is True:
self.draw_tail = self.draw_tail_navigable

View File

@ -67,7 +67,6 @@ follows
Folding and unfolding is performed by `InterfacePropertyPage` class.
"""
from __future__ import division
from math import pi

View File

@ -1,7 +1,6 @@
"""
Unnit tests for AssociationItem.
"""
from __future__ import print_function
from zope import component
from gaphor.diagram.interfaces import IConnect

View File

@ -1,10 +1,7 @@
"""
Diagram item with compartments.
"""
from __future__ import division
from builtins import object
from builtins import zip
import logging
import cairo

View File

@ -3,7 +3,6 @@ DiagramItem provides basic functionality for presentations.
Such as a modifier 'subject' property and a unique id.
"""
from builtins import object
from zope import component
from gaphas.state import observed, reversible_property
@ -14,7 +13,6 @@ from gaphor.core import inject
from gaphor.diagram import DiagramItemMeta
from gaphor.diagram.textelement import EditableTextSupport
from gaphor.diagram.style import ALIGN_CENTER, ALIGN_TOP
from future.utils import with_metaclass
logger = getLogger("Diagram")
@ -129,10 +127,8 @@ class StereotypeSupport(object):
class DiagramItem(
with_metaclass(
DiagramItemMeta,
type("NewBase", (UML.Presentation, StereotypeSupport, EditableTextSupport), {}),
)
type("NewBase", (UML.Presentation, StereotypeSupport, EditableTextSupport), {}),
metaclass=DiagramItemMeta,
):
"""
Basic functionality for all model elements (lines and elements!).

View File

@ -1,10 +1,7 @@
"""
Basic functionality for canvas line based items on a diagram.
"""
from __future__ import division
from builtins import map
from builtins import range
from math import atan2, pi
import gaphas

View File

@ -1,7 +1,6 @@
"""
Interaction diagram item.
"""
from __future__ import division
from gaphor import UML
from gaphor.diagram.nameditem import NamedItem

View File

@ -19,10 +19,7 @@ cannot be supported. Still, destruction event notation is shown at the
bottom of the lifeline's lifetime when delete message is connected to a
lifeline.
"""
from __future__ import division
from builtins import object
from builtins import map
from gaphas.item import SW, SE
from gaphas.connector import Handle, LinePort
from gaphas.solver import STRONG

View File

@ -45,7 +45,6 @@ operation information in message's name.
See also ``lifeline`` module documentation.
"""
from __future__ import division
from math import pi

View File

@ -1,10 +1,7 @@
"""
Trivial drawing aids (box, line, ellipse).
"""
from __future__ import division
from builtins import map
from builtins import range
from gaphas.item import Element, NW
from gaphas.item import Line as _Line
from gaphas.util import path_ellipse

View File

@ -1,12 +1,6 @@
"""
Style classes and constants.
"""
from __future__ import division
from builtins import object
from builtins import range
from past.builtins import cmp
from math import pi
# padding
PADDING_TOP, PADDING_RIGHT, PADDING_BOTTOM, PADDING_LEFT = list(range(4))
@ -259,7 +253,7 @@ def get_text_point_at_line2(extents, p1, p2, align, padding):
# determine quadrant, we are interested in 1 or 3 and 2 or 4
# see hint tuples below
h2 = height / 2.0
q = cmp(d1, 0)
q = (d1 > 0) - (d1 < 0)
if abs(dx) < EPSILON:
hint = 0
else:

View File

@ -2,7 +2,6 @@
Test item styles.
"""
from builtins import range
import unittest
from gaphor.diagram.style import (

View File

@ -2,10 +2,8 @@
Support for editable text, a part of a diagram item, i.e. name of named
item, guard of flow item, etc.
"""
from __future__ import division
import math
from builtins import object
import cairo
import gi

View File

@ -1,7 +1,6 @@
"""
Use case diagram item.
"""
from __future__ import division
from gaphas.util import path_ellipse

View File

@ -2,7 +2,6 @@
Application wide events are managed here.
"""
from builtins import object
from zope.interface import implementer
from gaphor.interfaces import *

View File

@ -4,7 +4,6 @@ A version of the standard Gtk.ColorButton tweaked towards Gaphor.
Gaphor is using color values from 0 to 1 (cairo standard), so that required some tweaks
on the color widget. The standard format is `(red, green, blue, alpha)`.
"""
from __future__ import division
from gi.repository import Gtk

View File

@ -8,14 +8,11 @@
import code
import sys
from builtins import object
from future import standard_library
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import Pango
standard_library.install_aliases()
banner = (
"""Gaphor Interactive Python Console

View File

@ -11,16 +11,11 @@ QueueEmpty - raised when one tried to get a value of an empty queue
QueueFull - raised when the queue reaches it's max size and the oldest item
may not be disposed.
"""
from __future__ import print_function
from builtins import object
from builtins import next
from builtins import range
import types
import sys
from gi.repository import GLib
import time
import traceback
class GIdleThread(object):
@ -132,7 +127,6 @@ class GIdleThread(object):
return False
except:
self._exc_info = sys.exc_info()
# traceback.print_exc()
self._idle_id = 0
return False

View File

@ -10,10 +10,6 @@ See the documentation on the mixins.
"""
from builtins import object
from builtins import filter
from past.builtins import basestring
__all__ = ["querymixin", "recursemixin", "getslicefix"]
import sys
@ -123,7 +119,7 @@ def issafeiterable(obj):
False
"""
try:
return iter(obj) and not isinstance(obj, basestring)
return iter(obj) and not isinstance(obj, str)
except TypeError:
pass
return False

View File

@ -1,6 +1,4 @@
# from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747
from builtins import map
from builtins import zip
class odict(dict):

View File

@ -1,4 +1,3 @@
from builtins import object
import sys
import unittest
from gaphor.misc.xmlwriter import XMLWriter

View File

@ -1,8 +1,5 @@
# vim:sw=4:et
import sys
import xml.sax.handler
from builtins import str
from xml.sax.saxutils import escape, quoteattr
# See whether the xmlcharrefreplace error handler is

View File

@ -1,9 +1,7 @@
"""
This plugin extends Gaphor with XMI alignment actions.
"""
from __future__ import division
from builtins import object
from zope import component
from zope.interface import implementer

View File

@ -1,6 +1,3 @@
from __future__ import print_function
from builtins import map
from gaphor import UML
from os import path

View File

@ -1,10 +1,8 @@
"""
A GUI for the checkmodel plugin.
"""
from __future__ import print_function
import logging
from builtins import object
import gi

View File

@ -9,11 +9,9 @@ The layout is done like this:
- Lines are reconnected to the nodes, so everything looks pretty.
"""
from __future__ import division
import logging
import random
from builtins import object
from zope.interface import implementer

View File

@ -1,8 +1,3 @@
from __future__ import print_function
from builtins import filter
from builtins import range
class RecursionError(OverflowError, ValueError):
"""Unable to calculate result because of recursive structure"""

View File

@ -4,8 +4,6 @@ Plugin based on the Live Object browser
It shows the state of the data model at the time the browser is activated.
"""
from builtins import object
from zope.interface import implementer
from gaphor.core import inject, action, build_action_group

View File

@ -12,9 +12,6 @@ Description:
Given an object, this tool throws up a gtk tree widget that maps all the references found. It dynamically builds the tree, which means it can handle large amounts of data and circular references.
"""
from builtins import str
from builtins import range
from builtins import object
from gi.repository import Gtk

View File

@ -7,8 +7,6 @@ This plugin uses PyNSource, written by Andy Bulka
Depends on the Diagram Layout plugin.
"""
from builtins import object
from gi.repository import GObject
from gi.repository import Gtk
from zope.interface import implementer

View File

@ -1,15 +1,14 @@
"""The code reverse engineer.
"""
from __future__ import print_function
from builtins import object
from zope import component
from gaphor import UML
from gaphor.diagram import items
from gaphor.core import inject
from gaphor.diagram.interfaces import IConnect
from gaphas.aspect import ConnectionSink, Connector
from gaphor import UML
from gaphor.core import inject
from gaphor.diagram import items
from gaphor.diagram.interfaces import IConnect
from gaphor.plugins.pynsource.pynsource import PySourceAsText
BASE_CLASSES = ("object", "type", "dict", "list", "tuple", "int", "float")

View File

@ -65,11 +65,7 @@ then the command is
pynsource -j src pythoninput01\*.py
"""
from __future__ import print_function
from builtins import str
from builtins import range
from builtins import object
from functools import cmp_to_key
import os
import pprint

View File

@ -2,7 +2,6 @@
This plugin extends Gaphor with XMI export functionality.
"""
from builtins import object
from logging import getLogger
from zope.interface import implementer

View File

@ -1,5 +1,3 @@
from builtins import object
from builtins import str
from logging import getLogger
from gaphor.misc.xmlwriter import XMLWriter

View File

@ -1,7 +1,6 @@
"""
"""
from builtins import object
from logging import getLogger
from zope import component

View File

@ -1,5 +1,3 @@
from builtins import object
from zope.interface import implementer
from gaphor.interfaces import IService

View File

@ -6,8 +6,6 @@ Maybe we should split the ComponentRegistry in a Dispatcher (register_handler,
unregister_handler, handle), a AdapterRegistry and a Subscription registry.
"""
from builtins import map
from builtins import object
from zope import component
from zope.interface import registry

View File

@ -2,8 +2,6 @@
Copy / Paste functionality
"""
from builtins import object
from builtins import str
from zope import component
import gaphas

View File

@ -1,7 +1,6 @@
"""Service dedicated to exporting diagrams to a variety of file formats."""
import os
from builtins import object
from logging import getLogger
import cairo

View File

@ -1,7 +1,6 @@
"""
"""
from builtins import object
from zope.interface import implementer
from zope import component

View File

@ -3,8 +3,6 @@ The file service is responsible for loading and saving the user data.
"""
import logging
from builtins import object
from builtins import range
from zope import component
from gi.repository import Gtk

View File

@ -1,7 +1,6 @@
"""About and help services. (help browser anyone?)"""
import os
from builtins import object
from logging import getLogger
import pkg_resources

View File

@ -4,7 +4,6 @@ file system. These are things like preferences."""
import os
import pprint
import sys
from builtins import object
from logging import getLogger
from zope import interface

View File

@ -1,7 +1,6 @@
"""
"""
from builtins import object
from logging import getLogger
from zope import component

View File

@ -3,7 +3,6 @@ The Sanitize module is dedicated to adapters (stuff) that keeps
the model clean and in sync with diagrams.
"""
from builtins import object
from logging import getLogger
from zope import component

View File

@ -5,13 +5,11 @@ retrieved.
Our good old NameServicer.
"""
from builtins import object
from builtins import next
from zope import interface, component
from logging import getLogger
from gaphor.interfaces import IService
from zope import component
from gaphor.core import inject
from gaphor.interfaces import IService
class ServiceRegistry(object):

View File

@ -1,5 +1,3 @@
from __future__ import print_function
import unittest

View File

@ -1,5 +1,3 @@
from __future__ import print_function
from gaphor.tests import TestCase
from gaphor import UML
from gaphor.application import Application

View File

@ -1,7 +1,6 @@
from builtins import range
import unittest
from gaphor.application import Application
from gaphor.services.filemanager import FileManager
class FileManagerTestCase(unittest.TestCase):

View File

@ -12,7 +12,6 @@ If None is returned the undo action is considered to be the redo action as well.
NOTE: it would be nice to use actions in conjunction with functools.partial.
"""
from builtins import object
from logging import getLogger
from zope import component

View File

@ -30,22 +30,14 @@ The generator parse_generator(filename, loader) may be used if the loading
takes a long time. The yielded values are the percentage of the file read.
"""
from __future__ import division
__all__ = ["parse", "ParserException"]
import io
import os
from xml.sax import handler
from builtins import object
from builtins import range
from future import standard_library
from gaphor.misc.odict import odict
standard_library.install_aliases()
class base(object):
"""Simple base class for element, canvas and canvasitem.

View File

@ -8,9 +8,6 @@ save(filename)
store the current model in a file
"""
from __future__ import division
from __future__ import print_function
__all__ = ["load", "save"]
import gc
@ -19,9 +16,6 @@ import os.path
import io
import gaphas
from builtins import map
from builtins import str
from future import standard_library
from gaphor import UML
from gaphor import diagram
@ -39,8 +33,6 @@ from gaphor.storage import parser
# depend on connectors service?
from gaphor.adapters import connectors
standard_library.install_aliases()
FILE_FORMAT_VERSION = "3.0"
NAMESPACE_MODEL = "http://gaphor.sourceforge.net/model"

View File

@ -2,7 +2,6 @@
Unittest the storage and parser modules
"""
from builtins import object
import io
import os
import os.path
@ -10,9 +9,6 @@ import re
from io import StringIO
import pkg_resources
from builtins import map
from builtins import next
from future import standard_library
from gaphor import UML
from gaphor.diagram import items
@ -20,10 +16,6 @@ from gaphor.misc.xmlwriter import XMLWriter
from gaphor.storage import storage
from gaphor.tests.testcase import TestCase
standard_library.install_aliases()
# __module__ = 'test_storage'
class PseudoFile(object):
def __init__(self):

View File

@ -1,6 +1,5 @@
"""Unit tests for transactions in Gaphor."""
from builtins import str
from unittest import TestCase
from zope.component.globalregistry import base

View File

@ -5,12 +5,10 @@ Everything is about services so the TestCase can define it's required
services and start off.
"""
from builtins import object
import logging
import unittest
from io import StringIO
from future import standard_library
from gaphas.aspect import ConnectionSink, Connector
from zope import component
@ -22,8 +20,6 @@ from gaphor.diagram.interfaces import IGroup
# For DiagramItemConnector aspect:
import gaphor.ui.diagramtools
standard_library.install_aliases()
log = logging.getLogger("Gaphor")
log.setLevel(logging.WARNING)

View File

@ -1,6 +1,5 @@
#!/usr/bin/python
from __future__ import print_function
import gaphor
from gaphor.storage import storage
import gaphor.UML as UML

View File

@ -2,7 +2,6 @@
Transaction support for Gaphor
"""
from builtins import object
import logging
from zope.interface import implementer

View File

@ -2,7 +2,6 @@
import logging
import os
from builtins import object
from zope.interface import implementer

View File

@ -1,11 +1,6 @@
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
import logging
from builtins import object
from builtins import str
from zope import component
from gaphas.freehand import FreeHandPainter

View File

@ -6,8 +6,6 @@ The Toolbox is bound to a diagram. When a diagram page (tab) is switched,
the actions bound to the toolbuttons should change as well.
"""
from builtins import object
from builtins import zip
from gaphas.item import SE
from zope import component

View File

@ -8,7 +8,6 @@ Although Gaphas has quite a few useful tools, some tools need to be extended:
"""
import logging
from builtins import object
from zope import component
from gaphas.aspect import Connector, InMotion

View File

@ -1,7 +1,6 @@
"""The element editor is a utility window used for editing elements."""
import logging
from builtins import object
from zope.interface import implementer

View File

@ -1,5 +1,3 @@
from builtins import object
from zope.interface import implementer
from gaphor.ui.interfaces import IDiagramSelectionChange, IDiagramPageChange, IDiagram

View File

@ -1,7 +1,6 @@
"""This module has a generic FileDialog class that is used to open
or save files."""
from builtins import object
from gi.repository import Gtk

View File

@ -18,12 +18,6 @@
# along with etkdocking. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from builtins import str
from builtins import map
import sys
from simplegeneric import generic
from xml.etree.ElementTree import fromstring

View File

@ -4,15 +4,13 @@ The main application window.
import logging
import os.path
from builtins import object
from builtins import str
from zope import component
import pkg_resources
from gi.repository import GLib
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import GdkPixbuf
import pkg_resources
from gi.repository import Gtk
from zope.interface import implementer
from gaphor import UML
@ -22,7 +20,6 @@ from gaphor.core import (
inject,
action,
toggle_action,
open_action,
build_action_group,
transactional,
)

View File

@ -3,12 +3,9 @@ This is the TreeView that is most common (for example: it is used
in Rational Rose). This is a tree based on namespace relationships. As
a result only classifiers are shown here.
"""
from __future__ import print_function
import logging
import operator
from builtins import map
from builtins import str
# PyGTKCompat used for Gtk.GenericTreeModel Support
import pygtkcompat

View File

@ -3,7 +3,6 @@
import logging
from builtins import object
from gi.repository import Gtk
from zope import component

View File

@ -1,7 +1,6 @@
"""Defines a QuestionDialog class used to get a yes or no answer from the user.
"""
from builtins import object
from gi.repository import Gtk

View File

@ -1,12 +1,7 @@
"""Defines a status window class for displaying the progress of
a queue."""
from __future__ import division
from builtins import object
from gi.repository import GLib
from gi.repository import Pango
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import GLib, Gdk, Gtk, Pango
from gaphor.misc.gidlethread import QueueEmpty

View File

@ -1,10 +1,8 @@
from builtins import object
from gi.repository import Gtk
from gaphor.tests.testcase import TestCase
from gaphor.application import Application
from gaphor.ui.diagrampage import DiagramPage
from gaphor.ui.diagramtoolbox import DiagramToolbox, TOOLBOX_ACTIONS
from gaphor import UML
from gaphor.tests.testcase import TestCase
from gaphor.ui.diagrampage import DiagramPage
from gaphor.ui.diagramtoolbox import TOOLBOX_ACTIONS
class WindowOwner(object):

View File

@ -1,6 +1,3 @@
from __future__ import print_function
from builtins import object
from gaphor.tests.testcase import TestCase
import gaphor.UML as UML
from gaphor.ui.namespace import NamespaceModel

View File

@ -3,7 +3,6 @@ Basic stuff for toplevel windows.
"""
import os.path
from builtins import object
from gi.repository import GdkPixbuf
from gi.repository import Gtk

Some files were not shown because too many files have changed in this diff Show More