Skip to content

Commit

Permalink
Update of scripts/metadata_table.py and scripts/parse_tools/parse_che…
Browse files Browse the repository at this point in the history
…ckers.py based on code review: remove old code in main, add missing code from feature/capgen
  • Loading branch information
climbfuji committed Aug 18, 2021
1 parent e91b2a4 commit 53aa9dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions scripts/metadata_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def __init_from_file(self, known_ddts, logger):
# end if
self.__table_type = value
elif key == 'dependencies':
if value.lower() == "none" or value.strip() == '':
if value.lower() == "none":
if self.__dependencies:
emsg = "dependencies = {} is ".format(value)
depends = ", ".join(self.__dependencies)
Expand Down Expand Up @@ -735,12 +735,6 @@ def __init_from_file(self, table_name, table_type, known_ddts, logger):
self.__module_name = 'INVALID' # Allow error continue
self.__section_valid = False
# end if
elif key == 'dependencies':
if not(value == "None" or value == ""):
# Remove trailing comma, remove white spaces from each list element
self._dependencies += [ v.strip() for v in value.rstrip(",").split(",") ]
elif key == 'relative_path':
relative_path_local = value.strip()
elif key == 'process':
self.__process_type = value
else:
Expand Down Expand Up @@ -781,6 +775,10 @@ def __init_from_file(self, table_name, table_type, known_ddts, logger):
if self.header_type == "ddt":
known_ddts.append(self.title)
# end if
# We need a default module if none was listed
if self.module is None:
self.__module_name = self._default_module()
# end if
# Initialize our ParseSource parent
super(MetadataSection, self).__init__(self.title,
self.header_type, self.__pobj)
Expand Down
3 changes: 1 addition & 2 deletions scripts/parse_tools/parse_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
import os.path
sys.path.insert(0, os.path.dirname(__file__))
# CCPP framework imports
from parse_source import CCPPError, ParseInternalError

########################################################################
Expand Down Expand Up @@ -203,8 +204,6 @@ def check_cf_standard_name(test_val, prop_dict, error):

########################################################################

# LITERAL_INT is a string representing an integer value
LITERAL_INT = r"([0-9]*)"
# FORTRAN_ID is a string representing the regular expression for Fortran names
FORTRAN_ID = r"([A-Za-z][A-Za-z0-9_]*)"
__FID_RE = re.compile(FORTRAN_ID+r"$")
Expand Down

0 comments on commit 53aa9dc

Please sign in to comment.