Source code for bspump.common.mapping
import collections.abc
from ..abc.processor import Processor
from ..abc.generator import Generator
[docs]
class MappingKeysProcessor(Processor):
"""
Description: Mapping Keys Processor
|
"""
[docs]
def process(self, context, event: collections.abc.Mapping) -> list:
"""
Description: process is a method of a Mapping Keys Processor
:return: event.keys()
|
"""
return [*event.keys()]
[docs]
class MappingValuesProcessor(Processor):
"""
Description:
|
"""
[docs]
def process(self, context, event: collections.abc.Mapping) -> list:
"""
Description:
:return: event.values()
|
"""
return [*event.values()]
[docs]
class MappingItemsProcessor(Processor):
"""
Description:
|
"""
[docs]
def process(self, context, event: collections.abc.Mapping) -> list:
"""
Description:
:return: event.items()
|
"""
return [*event.items()]
[docs]
class MappingKeysGenerator(Generator):
"""
Description:
|
"""
[docs]
async def generate(self, context, event, depth):
"""
Description:
"""
for item in event.keys():
self.Pipeline.inject(context, item, depth)
[docs]
class MappingValuesGenerator(Generator):
"""
Description:
|
"""
[docs]
async def generate(self, context, event, depth):
"""
Description:
|
"""
for item in event.values():
self.Pipeline.inject(context, item, depth)
[docs]
class MappingItemsGenerator(Generator):
"""
Description:
|
"""
[docs]
async def generate(self, context, event, depth):
"""
Description:
|
"""
for item in event.items():
self.Pipeline.inject(context, item, depth)