Skip to content

Conversation

stuchalk
Copy link

@stuchalk stuchalk commented Oct 4, 2022

Addition of Python a bare bones function call 'scrape' (functions.py file) for processing config file from another Python script and returning the JSON output.

…from another Python script and returning the JSON output
Copy link
Collaborator

@IanLee1521 IanLee1521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuchalk - this looks good overall.. Do you think this would be good to adapt the main script to use this method as well? Just for consistency?

Comment on lines +25 to +26
f = open(configfile)
config_json = json.load(f)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f = open(configfile)
config_json = json.load(f)
with open(configfile) as fp:
config_json = json.load(fp)

# process
code_json = code_gov.process_config(config_json)
code_gov.force_attributes(code_json, config_json)
logger.info("Number of Projects: %s", len(code_json["releases"]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this logger call should move in to code_gov.process_config(...) so that the message happens at the time the objects are parsed? Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants