Example #1
0
 def buildGroup(self):
     workspace.objects += [self]
     workspace.structures += [self]
     self.string.objects += [self]
     for objekt in self.objectList:
         objekt.group = self
     workspace.buildDescriptions(self)
     self.activateDescriptions()
Example #2
0
 def buildGroup(self):
     workspace.objects += [self]
     workspace.structures += [self]
     self.string.objects += [self]
     for objekt in self.objectList:
         objekt.group = self
     workspace.buildDescriptions(self)
     self.activateDescriptions()
Example #3
0
 def addDescriptions(self, descriptions):
     copy = descriptions[:]  # in case we add to our own descriptions
     for description in copy:
         logging.info('might add: %s', description)
         if not self.containsDescription(description):
             self.addDescription(description.descriptionType,
                                 description.descriptor)
         else:
             logging.info("Won't add it")
     from workspace import workspace
     workspace.buildDescriptions(self)
Example #4
0
 def addDescriptions(self, descriptions):
     copy = descriptions[:]  # in case we add to our own descriptions
     for description in copy:
         logging.info('might add: %s', description)
         if not self.containsDescription(description):
             self.addDescription(description.descriptionType,
                                 description.descriptor)
         else:
             logging.info("Won't add it")
     from workspace import workspace
     workspace.buildDescriptions(self)
Example #5
0
 def addDescriptions(self, descriptions):
     #print 'addDescriptions 1'
     #print 'add %d to %d of %s' % (len(descriptions),len(self.descriptions), self.string.string)
     copy = descriptions[:]  # in case we add to our own descriptions, which turns the loop infinite
     for description in copy:
         #print '%d addDescriptions 2 %s ' % (len(descriptions),description)
         logging.info('might add: %s' % description)
         if not self.containsDescription(description):
             #print '%d addDescriptions 3 %s ' % (len(descriptions),description)
             self.addDescription(description.descriptionType, description.descriptor)
             #print '%d addDescriptions 4 %s ' % (len(descriptions),description)
         else:
             logging.info("Won't add it")
     #print '%d added, have %d ' % (len(descriptions),len(self.descriptions))
     from workspace import workspace
     workspace.buildDescriptions(self)
Example #6
0
    def __init__(self, s):
        self.string = s
        self.bonds = []
        self.objects = []
        self.letters = []
        self.length = len(s)
        self.intraStringUnhappiness = 0.0
        if not self.length:
            return
        position = 0
        from workspace import workspace

        for c in self.string.upper():
            value = ord(c) - ord('A')
            letter = Letter(self, position + 1, self.length)
            letter.workspaceString = self
            letter.addDescription(slipnet.objectCategory, slipnet.letter)
            letter.addDescription(slipnet.letterCategory, slipnet.letters[value])
            letter.describe(position + 1, self.length)
            workspace.buildDescriptions(letter)
            self.letters += [letter]
            position += 1
Example #7
0
    def __init__(self, s):
        self.string = s
        self.bonds = []
        self.objects = []
        self.letters = []
        self.length = len(s)
        self.intraStringUnhappiness = 0.0
        if not self.length:
            return
        position = 0
        from workspace import workspace

        for c in self.string.upper():
            value = ord(c) - ord('A')
            letter = Letter(self, position + 1, self.length)
            letter.workspaceString = self
            letter.addDescription(slipnet.objectCategory, slipnet.letter)
            letter.addDescription(slipnet.letterCategory,
                                  slipnet.letters[value])
            letter.describe(position + 1, self.length)
            workspace.buildDescriptions(letter)
            self.letters += [letter]
            position += 1