mirror of
git://holbrook.no/eth-monitor.git
synced 2024-11-23 12:26:45 +01:00
Handle filters and renderers from args in settings
This commit is contained in:
parent
2f3e652ca3
commit
fe9b657b36
@ -1,3 +1,6 @@
|
|||||||
|
- 0.5.1
|
||||||
|
* Remove useless need to add session dir for mem backend
|
||||||
|
* Reenable renderers and filters specified through args in new settings setup
|
||||||
- 0.5.0
|
- 0.5.0
|
||||||
* Implement on chainlib 0.3.0
|
* Implement on chainlib 0.3.0
|
||||||
- 0.4.8
|
- 0.4.8
|
||||||
|
@ -315,6 +315,15 @@ def process_out_filter(settings, config):
|
|||||||
return settings
|
return settings
|
||||||
|
|
||||||
|
|
||||||
|
def process_arg_filter(settings, config):
|
||||||
|
store = settings.get('SYNC_STORE')
|
||||||
|
for k in config.get('ETHMONITOR_FILTER'):
|
||||||
|
m = importlib.import_module(k)
|
||||||
|
fltr = m.Filter()
|
||||||
|
store.register(fltr)
|
||||||
|
return settings
|
||||||
|
|
||||||
|
|
||||||
def process_filter(settings, config):
|
def process_filter(settings, config):
|
||||||
settings.set('FILTER', [])
|
settings.set('FILTER', [])
|
||||||
settings = process_renderer(settings, config)
|
settings = process_renderer(settings, config)
|
||||||
@ -322,12 +331,13 @@ def process_filter(settings, config):
|
|||||||
settings = process_cache_filter(settings, config)
|
settings = process_cache_filter(settings, config)
|
||||||
settings = process_tx_filter(settings, config)
|
settings = process_tx_filter(settings, config)
|
||||||
settings = process_out_filter(settings, config)
|
settings = process_out_filter(settings, config)
|
||||||
|
settings = process_arg_filter(settings, config)
|
||||||
return settings
|
return settings
|
||||||
|
|
||||||
|
|
||||||
def process_renderer(settings, config):
|
def process_renderer(settings, config):
|
||||||
renderers_mods = []
|
renderers_mods = []
|
||||||
for renderer in list_from_prefix(config, 'renderer'):
|
for renderer in config.get('ETHMONITOR_RENDERER'):
|
||||||
m = importlib.import_module(renderer)
|
m = importlib.import_module(renderer)
|
||||||
renderers_mods.append(m)
|
renderers_mods.append(m)
|
||||||
logg.info('using renderer module {}'.format(renderer))
|
logg.info('using renderer module {}'.format(renderer))
|
||||||
|
@ -2,5 +2,5 @@ chainlib-eth~=0.3.0
|
|||||||
chainlib~=0.3.0
|
chainlib~=0.3.0
|
||||||
chainsyncer~=0.5.0
|
chainsyncer~=0.5.0
|
||||||
leveldir~=0.3.0
|
leveldir~=0.3.0
|
||||||
eth-cache~=0.1.5
|
eth-cache~=0.1.6
|
||||||
confini~=0.6.2
|
confini~=0.6.3
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = eth-monitor
|
name = eth-monitor
|
||||||
version = 0.5.0
|
version = 0.5.1
|
||||||
description = Monitor and cache transactions using match filters
|
description = Monitor and cache transactions using match filters
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
author_email = dev@holbrook.no
|
||||||
|
Loading…
Reference in New Issue
Block a user