コード例 #1
0
    def __init__(self, key, func, **options):
        
        # Calling super class
        DeltaObject.__init__(self)
        
        self.__key = key
        self.__func = func

        self.__before_execution_funcs = options.get('before_execution_funcs')
        if self.__before_execution_funcs is None:
            self.__before_execution_funcs = []

        self.__after_execution_funcs = options.get('after_execution_funcs')
        if self.__after_execution_funcs is None:
            self.__after_execution_funcs = []

        self.__on_execution_failed_funcs = options.get('execution_failed_funcs')
        if self.__on_execution_failed_funcs is None:
            self.__on_execution_failed_funcs = []

        self.__manager = None
        self.__description = options.get('description', None)
        permissions = options.get('permissions', None)
        self.__permissions = permissions or []
        self.__executor = None
        if hasattr(func,'location'):
            self.location = func.location
        else:
            self.location = func.__module__
        self.__options = options
コード例 #2
0
 def __init__(self):
     DeltaObject.__init__(self)
     self._processors = {}
     self._hooks = []
     self._default_processor_name = None
     self._event = Event()
     self._event.clear()
コード例 #3
0
 def __init__(self, name, short_option, long_option, help):
     DeltaObject.__init__(self)
     self.parser = optparse.OptionParser()
     self.short_option = short_option
     self.long_option = long_option
     self.help = help
     self._set_name_(name)
コード例 #4
0
    def __init__(self, name, size, **options):
        DeltaObject.__init__(self)
        self._set_name_(name)
        self._options = options

        self.__size = 0
        self.set_size(size)
コード例 #5
0
    def __init__(self, manager, connection, auto_commit=False, parent=None):
        DeltaObject.__init__(self)

        #        self.__status = Transaction.StatusEnum.ACTIVE
        #        self._manager = manager
        #        self._childs = []
        #        self._parent = parent
        #        self.connection = connection
        #        self.id = get_uuid()
        #        self.creation_date = datetime.datetime.now()
        #        if self._parent:
        #            self._parent._childs.append(self)
        #        self._auto_commit = auto_commit
        #        self._finalized = False

        self.__status = Transaction.StatusEnum.ACTIVE
        self.__manager = weakref.ref(manager)
        self._childs = []
        self.__parent = None
        if parent:
            self.__parent = weakref.ref(parent)
        self.__connection = weakref.ref(connection)
        self.id = get_uuid()
        self.creation_date = datetime.datetime.now()
        if self.get_parent():
            self.get_parent()._childs.append(self)
        self._auto_commit = auto_commit
        self._finalized = False
        self._after_rollback_triggers = []
        self._before_rollback_triggers = []
        self._before_commit_triggers = []
        self._after_commit_triggers = []
        self._timeout = 0
コード例 #6
0
 def __init__(self):
     DeltaObject.__init__(self)
     self._sessions = {}
     self._session_lock = threading.Lock()
     self._hooks = []
     unique_id_services.register_generator('session_id', SessionIDGenerator())
     deltapy.security.session.bootstrap.boot()
コード例 #7
0
    def __init__(self):
        '''
        Initializes simple recorder.
        '''

        DeltaObject.__init__(self)

        self._set_name_('simple_recorder')
コード例 #8
0
    def __init__(self):
        '''
        Initializes reverse manager.
        '''

        DeltaObject.__init__(self)

        self._reversers = {}
コード例 #9
0
    def __init__(self):
        '''
        Initializes transaction coordinator.
        '''

        DeltaObject.__init__(self)

        add_hook(TransactionCoordinatorCommandExecutionHook())
コード例 #10
0
    def __init__(self):
        '''
        '''

        DeltaObject.__init__(self)

        self._channels = {}
        self._enabled = None
コード例 #11
0
    def __init__(self):
        '''
        '''

        DeltaObject.__init__(self)

        self._actions = {}
        self._parser = optparse.OptionParser()
        self._load_()
コード例 #12
0
    def __init__(self):
        DeltaObject.__init__(self)
        self.caches = {}
        self.cache_lock = Lock()

        self._registered_cache_types = {}
        self._default_cache_type_name = None
        self.register_cache_type(MemoryCache.CACHE_TYPE_NAME, MemoryCache)
        self.register_cache_type(NullCache.CACHE_TYPE_NAME, NullCache)
コード例 #13
0
 def __init__(self, process_unit, size):
     DeltaObject.__init__(self)
     
     self.__process_unit = process_unit
     self.__last_error = None
     self.__size = size
     self.__error_count = 0
     self.__warning_count = 0
     self.__info_count = 0
コード例 #14
0
    def __init__(self):
        '''
        Initializes request holder.
        '''

        DeltaObject.__init__(self)

        self._transactions = {}
        self._requests = {}
コード例 #15
0
    def __init__(self):
        '''
        The constructor.
        '''

        DeltaObject.__init__(self)
        self.__factories = {}
        self.__listeners = {}
        self.__default_listener_name = None
        self.__hooks = []
コード例 #16
0
 def __init__(self, cache_name, **options):
     DeltaObject.__init__(self)
     self._set_name_(cache_name)
     self.__cache_id = get_uuid()
     self._creation_time = time.time()
     self._last_reset_time = time.time()
     self._lifetime = None
     self._scavenger = options.get('scavenger', None)
     if self._scavenger is not None:
         self._scavenger.initialize(self)
     self._size = int(options.get('size', 1024))
コード例 #17
0
    def __init__(self, key, reverser_function):
        '''

        :param key:
        :param function:
        '''

        DeltaObject.__init__(self)

        self._set_name_(key)
        self._reverser_function = reverser_function
コード例 #18
0
    def __init__(self):
        '''
        Initializes request record manager.
        '''

        DeltaObject.__init__(self)

        self._recorders = {}
        self._request_holder = None

        self._register_holder()
        self._register_recorders()
コード例 #19
0
    def __init__(self, key, **options):
        '''
        Initializes request coordinator decorator.

        @param key: recorder key
        @param recorder_type: recorder type
        '''

        DeltaObject.__init__(self)

        self._set_name_(key)
        self._recorder_type = options.get('recorder_type', 'full_recorder')
        self._should_be_reversed = options.get('should_be_reversed', True)
コード例 #20
0
    def __init__(self):
        """
        Inits!
        """

        DeltaObject.__init__(self)

        #app.run(debug=True, threaded=True, use_reloader=False)
        run_in_thread(flask_app.run,
                      debug=False,
                      threaded=True,
                      use_reloader=False,
                      host='0.0.0.0',
                      port=5001)
コード例 #21
0
 def __init__(self,
              default_settings_folder_name = 'settings',
              defaults = {}):
     # Calling the super class
     DeltaObject.__init__(self)
     
     # Setting default configuration folder name.
     self.__default_settings_folder_name = default_settings_folder_name
     
     # Configuration stores
     self.__config_stores = {}
     
     # Setting default options
     self._defaults = defaults
コード例 #22
0
    def __init__(self):

        # Calling super class
        DeltaObject.__init__(self)

        # Setting this application instance in a global variable
        _set_app_(self)

        self.__instance_name = None
        self.__options = {}
        self.sub_app_proxies = {}
        self.context = ApplicationContext()
        self.parent_proxy = None
        print ">> Initializing application[%s] ..." % self.get_name()

        # Loading package manager...
        self.context[APP_PACKAGING] = PackageManager()
コード例 #23
0
    def __init__(self, manager, key, func, permissions=None):

        # Calling super class
        DeltaObject.__init__(self)

        self.__key = key
        self.__func = func
        self.__before_execution_funcs = []
        self.__after_execution_funcs = []
        if not manager:
            raise CommandException('Command manager is invalid.')
        self.__manager = manager
        self.__permissions = permissions or []
        self.__executor = None
        if hasattr(func, 'location'):
            self.__location = func.location
        else:
            self.__location = func.__module__

        manager.add_command(self)
コード例 #24
0
    def __init__(self, communicator, name, params, client_request_class=None):
        '''
        @param instance communicator: Instance of the communicator that
            this listener should work with.
        @param str name: Name of this listener.
        @param dict params: Configuration parameters for this listener.
        @keyword instance client_request_class: The class that should carry
            request around. Default is ClientRequest.
        '''
        DeltaObject.__init__(self)

        self.host = params.get('host')
        self.port = int(params.get('port'))
        self.__name = name
        self.__params = params
        self._communicator = communicator
        self.__enable = True
        self._client_request_class = client_request_class

        if self._client_request_class is None:
            self._client_request_class = RawRequest
コード例 #25
0
 def __init__(self):
     DeltaObject.__init__(self)
     self.__sub_packages__ = []
     self.__delta_module__ = True
     self.name = None
     self.module = None
コード例 #26
0
 def __init__(self):
     DeltaObject.__init__(self)
コード例 #27
0
 def __init__(self):
     DeltaObject.__init__(self)
     
     self._registered_generators = {}
コード例 #28
0
    def __init__(self):
        DeltaObject.__init__(self)

        self.__enable = True
コード例 #29
0
 def __init__(self, name):
     DeltaObject.__init__(self)
     self._set_name_(name)
     self._params = {}
コード例 #30
0
 def __init__(self, name, defaults={}):
     DeltaObject.__init__(self)
     self._set_name_(name)
     self._defaults = defaults