Пример #1
0
    def __init__(self, *args, **kwargs):
        Resource.__init__(self, *args, **kwargs)
        self.method_decorators = []

        if stat_manager.save_stat:
            self.method_decorators.append(self._stat_regions)
            self.method_decorators.append(manage_stat_caller(stat_manager))
Пример #2
0
    def __init__(self, quota=True, *args, **kwargs):
        Resource.__init__(self, *args, **kwargs)
        self.method_decorators = []

        self.method_decorators.append(self._stat_regions)
        if stat_manager.save_stat:
            self.method_decorators.append(manage_stat_caller(stat_manager))

        if quota:
            self.method_decorators.append(quota_control)
Пример #3
0
    def __init__(self, quota=True, *args, **kwargs):
        DocumentedResource.__init__(self, *args, **kwargs)
        self.method_decorators = {'get': []}
        self.get_decorators = self.method_decorators['get']

        self.get_decorators.append(self._stat_regions)
        if stat_manager.save_stat:
            self.get_decorators.append(manage_stat_caller(stat_manager))

        if quota:
            self.get_decorators.append(quota_control)
Пример #4
0
    def __init__(self, quota=True, *args, **kwargs):
        DocumentedResource.__init__(self, *args, **kwargs)
        self.method_decorators = {'get': []}
        self.get_decorators = self.method_decorators['get']
        # HEAD is an alias for GET, we need to have the same decorators
        self.method_decorators['head'] = self.method_decorators['get']

        self.get_decorators.append(self._stat_regions)
        if stat_manager.save_stat:
            self.get_decorators.append(manage_stat_caller(stat_manager))

        if quota:
            self.get_decorators.append(quota_control)