Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1867 | script to generate concept/mapping s…
Browse files Browse the repository at this point in the history
…tandard/smart checksum
  • Loading branch information
snyaggarwal committed Jul 8, 2024
1 parent 906b064 commit 5d43329
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ omit =
core/middlewares/*
*.css
*.html
generate_checksum.py
concurrency=multiprocessing
14 changes: 9 additions & 5 deletions generate_checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _serialize(obj):

def _cleanup(fields):
result = fields
if isinstance(fields, dict):
if isinstance(fields, dict): # pylint: disable=too-many-nested-blocks
result = {}
for key, value in fields.items():
if value is None:
Expand Down Expand Up @@ -174,9 +174,13 @@ def generate(resource, data, checksum_type='standard'):

def main():
parser = argparse.ArgumentParser(description='Generate checksum for resource data.')
parser.add_argument('resource', type=str, choices=['concept', 'mapping'], help='The type of resource (concept, mapping)')
parser.add_argument('data', type=str, help='The data for which checksum needs to be generated')
parser.add_argument('checksum_type', type=str, default='standard', choices=['standard', 'smart'], help='The type of checksum to generate (default: standard)')
parser.add_argument(
'resource', type=str, choices=['concept', 'mapping'], help='The type of resource (concept, mapping)')
parser.add_argument(
'data', type=str, help='The data for which checksum needs to be generated')
parser.add_argument(
'checksum_type', type=str, default='standard', choices=['standard', 'smart'],
help='The type of checksum to generate (default: standard)')

args = parser.parse_args()

Expand All @@ -197,4 +201,4 @@ def usage() -> None:


if __name__ == '__main__':
main()
main()

0 comments on commit 5d43329

Please sign in to comment.