Disentangle another reference to slipnet.
This commit is contained in:
@ -4,17 +4,6 @@ from slipnode import Slipnode
|
||||
from sliplink import Sliplink
|
||||
|
||||
|
||||
def distinguishingDescriptor(descriptor):
|
||||
"""Whether no other object of the same type has the same descriptor"""
|
||||
if descriptor == slipnet.letter:
|
||||
return False
|
||||
if descriptor == slipnet.group:
|
||||
return False
|
||||
if descriptor in slipnet.numbers:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class SlipNet(object):
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
def __init__(self):
|
||||
@ -58,6 +47,16 @@ class SlipNet(object):
|
||||
node.jump()
|
||||
node.buffer = 0.0
|
||||
|
||||
def isDistinguishingDescriptor(self, descriptor):
|
||||
"""Whether no other object of the same type has the same descriptor"""
|
||||
if descriptor == self.letter:
|
||||
return False
|
||||
if descriptor == self.group:
|
||||
return False
|
||||
if descriptor in self.numbers:
|
||||
return False
|
||||
return True
|
||||
|
||||
def __addInitialNodes(self):
|
||||
# pylint: disable=too-many-statements
|
||||
self.slipnodes = []
|
||||
|
||||
@ -2,7 +2,7 @@ import logging
|
||||
|
||||
from description import Description
|
||||
from formulas import weightedAverage
|
||||
from slipnet import slipnet, distinguishingDescriptor
|
||||
from slipnet import slipnet
|
||||
from workspaceStructure import WorkspaceStructure
|
||||
|
||||
|
||||
@ -170,13 +170,12 @@ class WorkspaceObject(WorkspaceStructure):
|
||||
return objectOnMyRightIsRightmost and objectOnMyLeftIsLeftmost
|
||||
|
||||
def distinguishingDescriptor(self, descriptor):
|
||||
# pylint: disable=no-self-use
|
||||
return distinguishingDescriptor(descriptor)
|
||||
return slipnet.isDistinguishingDescriptor(descriptor)
|
||||
|
||||
def relevantDistinguishingDescriptors(self):
|
||||
return [d.descriptor
|
||||
for d in self.relevantDescriptions()
|
||||
if distinguishingDescriptor(d.descriptor)]
|
||||
if slipnet.isDistinguishingDescriptor(d.descriptor)]
|
||||
|
||||
def getDescriptor(self, descriptionType):
|
||||
"""The description attached to this object of the description type."""
|
||||
|
||||
Reference in New Issue
Block a user