Example #1
0
 def __init__(self, irc):
     self.__parent = super(PieSpy, self)
     self.__parent.__init__(irc)
     for ircd in world.ircs:
         #version =
         outputDirectory = os.path.join(
             self.registryValue('image.outputDirectory'),
             "%s/" % ircd.network
             )
         #outputDirectory = os.path.join(conf.supybot.directories.data.dirize("PieSpy/"), "%s/" % ircd.network)
         netinstance = pyPie.PieInstance(
             ircd.nick, 
             ircd.network,
             outputDirectory=outputDirectory,
             temporalDecayAmount=self.registryValue('advanced.temporalDecayAmount'),
             springEmbedderIterations=self.registryValue('advanced.springEmbedderIterations'),
             k=self.registryValue('advanced.k'),
             c=self.registryValue('advanced.c'),
             maxRepulsiveForceDistance=self.registryValue('advanced.maxRepulsiveForceDistance'),
             maxNodeMovement=self.registryValue('advanced.maxNodeMovement'),
             minDiagramSize=self.registryValue('advanced.minDiagramSize'),
             borderSize=self.registryValue('advanced.borderSize'),
             nodeRadius=self.registryValue('advanced.nodeRadius'),
             edgeThreshold=self.registryValue('advanced.edgeThreshold'),
             showEdges=self.registryValue('advanced.showEdges'),
             adjacencyInferenceHeuristic=self.registryValue('heuristic.adjacencyInferenceHeuristic'),
             binarySequenceInferenceHeuristic=self.registryValue('heuristic.binarySequenceInferenceHeuristic'),
             directAddressingInferenceHeuristic=self.registryValue('heuristic.directAddressingInferenceHeuristic'),
             indirectAddressingInferenceHeuristic=self.registryValue('heuristic.indirectAddressingInferenceHeuristic'),
         )
         self.instances[ircd.network] = netinstance
         for channel in ircd.state.channels:
             ### Put the per-channel values into the channel's config
             # get the graph
             graph = netinstance.getGraph(channel)
             # pull out the config and copy it
             channelConfig = graph.config.copy()
             # put in the values
             channelConfig.update(
             	createCurrent=self.registryValue('image.createCurrent', channel),
             	createArchive=self.registryValue('image.createArchive', channel),
             	createRestorePoints=self.registryValue('image.createRestorePoints', channel),
                 outputWidth=self.registryValue('image.outputWidth', channel),
                 outputHeight=self.registryValue('image.outputHeight', channel),
                 backgroundColor=pyPie.getcolor(self.registryValue('color.backgroundColor', channel)),
                 channelColor=pyPie.getcolor(self.registryValue('color.channelColor', channel)),
                 labelColor=pyPie.getcolor(self.registryValue('color.labelColor', channel)),
                 titleColor=pyPie.getcolor(self.registryValue('color.titleColor', channel)),
                 nodeColor=pyPie.getcolor(self.registryValue('color.nodeColor', channel)),
                 edgeColor=pyPie.getcolor(self.registryValue('color.edgeColor', channel)),
                 borderColor=pyPie.getcolor(self.registryValue('color.borderColor', channel)),
                 ignoreSet=self.registryValue('ignore.ignoreSet', channel),
             )
             # put the config in the graph
             graph.config = channelConfig
             # queue names update
             irc.queueMsg(ircmsgs.names(channel))
Example #2
0
 def _addIrc(self, irc):
     # Let's just be extra-special-careful here.
     if irc not in self.ircstates:
         self.ircstates[irc] = irclib.IrcState()
     if irc not in self.lastmsg:
         self.lastmsg[irc] = ircmsgs.ping('this is just a fake message')
     if not world.testing:
         for channel in irc.state.channels:
             irc.queueMsg(ircmsgs.who(channel))
             irc.queueMsg(ircmsgs.names(channel))
Example #3
0
 def _addIrc(self, irc):
     # Let's just be extra-special-careful here.
     if irc not in self.ircstates:
         self.ircstates[irc] = irclib.IrcState()
     if irc not in self.lastmsg:
         self.lastmsg[irc] = ircmsgs.ping('this is just a fake message')
     if not world.testing:
         for channel in irc.state.channels:
             irc.queueMsg(ircmsgs.who(channel))
             irc.queueMsg(ircmsgs.names(channel))
Example #4
0
 def _addIrc(self, irc):
     # Let's just be extra-special-careful here.
     if irc not in self.ircstates:
         self.ircstates[irc] = irclib.IrcState()
     if irc not in self.lastmsg:
         self.lastmsg[irc] = ircmsgs.ping('this is just a fake message')
     if irc.afterConnect:
         # We've probably been reloaded.  Let's send some messages to get
         # our IrcState objects up to current.
         for channel in self.registryValue('channels'):
             irc.queueMsg(ircmsgs.who(channel))
             irc.queueMsg(ircmsgs.names(channel))