File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 33import json
44import os
55import sys
6+ from pathlib import Path
67
78from setuptools import find_packages , setup
89
1920exec (open (os .path .join (os .path .dirname (__file__ ),
2021 'intelmq/version.py' )).read ()) # defines __version__
2122BOTS = []
22- bots = json .load (open (os .path .join (os .path .dirname (__file__ ), 'intelmq/bots/BOTS' )))
23- for bot_type , bots in bots .items ():
24- for bot_name , bot in bots .items ():
25- module = bot ['module' ]
26- BOTS .append ('{0} = {0}:BOT.run' .format (module ))
23+
24+ base_path = Path (__file__ ).parent / 'intelmq/bots'
25+ botfiles = [botfile for botfile in Path (base_path ).glob ('**/*.py' ) if botfile .is_file () and not botfile .name .startswith ('_' )]
26+ for file in botfiles :
27+ module = '.' .join (file .with_suffix ('' ).parts )
28+ BOTS .append ('{0} = {0}:BOT.run' .format (module ))
2729
2830with open (os .path .join (os .path .dirname (__file__ ), 'README.rst' )) as handle :
2931 README = handle .read ()
You can’t perform that action at this time.
0 commit comments