Skip to content

Commit

Permalink
adjust variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor authored and nitaibezerra committed Apr 19, 2023
1 parent d7f0047 commit 1175947
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/dou_dag_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
from searchers import BaseSearcher, DOUSearcher, QDSearcher
from util import get_source_dir


YAMLS_START_DIR = os.path.join(get_source_dir(), 'dag_confs')

class DouDigestDagGenerator():
"""
YAML based Generator of DAGs that digests the DOU (gazette) daily
Expand All @@ -46,6 +43,7 @@ class DouDigestDagGenerator():
database.
"""

YAMLS_START_DIR = os.path.join(get_source_dir(), 'dag_confs')
parser = YAMLParser
searchers: Dict[str, BaseSearcher]

Expand Down Expand Up @@ -97,7 +95,7 @@ def prepare_doc_md(specs: DAGConfig, config_file: str) -> str:
doc_md = doc_md + "</dl>\n"
return doc_md

def find_yml_files(self, directory):
def find_yml_files(self):
"""
Recursively find all .yml and .yaml files inside a directory.
Expand All @@ -110,7 +108,7 @@ def find_yml_files(self, directory):
"""

yml_files = []
for root, dirs, files in os.walk(directory):
for root, dirs, files in os.walk(self.YAMLS_START_DIR):
for file in files:
if file.endswith(".yml") or file.endswith(".yaml"):
yml_files.append(os.path.join(root, file))
Expand All @@ -121,7 +119,7 @@ def generate_dags(self):
"""Iterates over the YAML files and creates all dags
"""

files_list = self.find_yml_files(YAMLS_START_DIR)
files_list = self.find_yml_files()

for file_path in files_list:
dag_specs = self.parser(file_path).parse()
Expand Down

0 comments on commit 1175947

Please sign in to comment.