示例#1
0
   def __init__(self, thread = None, closeDownValue = 0, tag=""):
      """\
      Microprocess initialiser.
      
      Subclasses must call this using the idiom super(TheClass, self).__init__()
      """
      self.init  = 1
      self.id,self.name = tupleId(self)
      self.name = self.name + tag
      self.__stopped = 0
      if thread is not None:
         self.__thread = thread
      else:
         self.__thread = None # Explicit better than implicit
         
      self.closeDownValue = closeDownValue
         
      self.scheduler = _nullscheduler
      self.tracker=cat.coordinatingassistanttracker.getcat()

      # If the client has defined a debugger in their class we don't want to override it.
      # However if they haven't, we provide them with one
      if not 'debugger' in list(self.__dict__.keys()):
         self.debugger = debug()
         self.debugger.useConfig()
         if self.debugger.areDebugging("microprocess.__init__", 5):
            self.debugger.debugmessage("microprocess.__init__", "Defining debugger for self", self.__class__)
示例#2
0
    def __init__(self, thread=None, closeDownValue=0, tag=""):
        """\
      Microprocess initialiser.
      
      Subclasses must call this using the idiom super(TheClass, self).__init__()
      """
        self.init = 1
        self.id, self.name = tupleId(self)
        self.name = self.name + tag
        self.__stopped = 0
        if thread is not None:
            self.__thread = thread
        else:
            self.__thread = None  # Explicit better than implicit

        self.closeDownValue = closeDownValue

        self.scheduler = _nullscheduler
        self.tracker = cat.coordinatingassistanttracker.getcat()

        # If the client has defined a debugger in their class we don't want to override it.
        # However if they haven't, we provide them with one
        if not 'debugger' in list(self.__dict__.keys()):
            self.debugger = debug()
            self.debugger.useConfig()
            if self.debugger.areDebugging("microprocess.__init__", 5):
                self.debugger.debugmessage("microprocess.__init__",
                                           "Defining debugger for self",
                                           self.__class__)
示例#3
0
    def __init__(self, host, port, nick, password, username):
        super(IRCClient, self).__init__()
        self.host = host
        self.port = port

        self.username = username        
        self.nick = nick
        self.password = password
        self.channels = {}

        self.debugger = debug()
        self.debugger.useConfig()
        sections = {"IRCClient.login" : 1,
                    "IRCClient.connect" : 1,
                    "IRCClient.disconnect" : 1,
                    "IRCClient.joinChannel" : 1,
                    "IRCClient.main" : 1}
        self.debugger.addDebug(**sections)
示例#4
0
    >>> x=Component.component()
    >>> idGen.newId(x)
    'Component.component_4'
    >>> idGen.strId(x)
    'Component.component_5'
    >>> idGen.numId()
    6
    >>> idGen.tupleId(x)
    (7, 'Component.component_7')

"""


import Axon.debug as debug

debugger = debug.debug()
debugger.useConfig()
Debug = debugger.debug

# idGen - A class to provide Unique Identifiers
#
# Ids can provide be provided as numerical, string or a tuple.
#
# numerical ids are integers allocated on a "next integer" basis.
# eg object 1, apple 2, orange 3. (Not object 1, apple 2, orange 3)
#
# string ids consist of the '__str__' of the object, with the numerical
# id tacked on the end.
#
# tuple ids consists : '(the numerical id, the string id)'
#
示例#5
0
Examples::

    >>> x=Component.component()
    >>> idGen.newId(x)
    'Component.component_4'
    >>> idGen.strId(x)
    'Component.component_5'
    >>> idGen.numId()
    6
    >>> idGen.tupleId(x)
    (7, 'Component.component_7')

"""

import Axon.debug as debug
debugger = debug.debug()
debugger.useConfig()
Debug = debugger.debug


# idGen - A class to provide Unique Identifiers
#
# Ids can provide be provided as numerical, string or a tuple.
#
# numerical ids are integers allocated on a "next integer" basis.
# eg object 1, apple 2, orange 3. (Not object 1, apple 2, orange 3)
#
# string ids consist of the '__str__' of the object, with the numerical
# id tacked on the end.
#
# tuple ids consists : '(the numerical id, the string id)'