New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing Creation of Opensuse data Files #156
Fixing Creation of Opensuse data Files #156
Conversation
Thanks @Princee215 ..works really well..just some minor fixes thats all |
@Princee215 lemme know when you have fixed the changes I have suggested .. I would love to approve this PR |
bin/package_build.py
Outdated
print("Couldn't pull. Error: ",str(e)) | ||
else: | ||
data = json.loads(data_source) | ||
regex_pattern = r"-(.*?)-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Princee215 could you move the regex_pattern
above (its seems like a constant), ... define it just below source_data
list
bin/package_build.py
Outdated
data_dict = {"packageName":package_name,"description":"","version":version} | ||
opensuse_list.append(data_dict) | ||
q_index = q[i] | ||
file_name = f'{DATA_FILE_LOCATION}/{q_index}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename q_index
to file_name
and rename the file_name
to file_path
bin/package_build.py
Outdated
file_name = f'{DATA_FILE_LOCATION}/{q_index}' | ||
with open(file_name,'w') as file: | ||
json.dump(opensuse_list,file,indent=2) | ||
print(f"Saved!\nfilename: {q_index}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove q_index
and rename as defined above
Sure, thanks @arshPratap, i see these changes. And I'll try to edit as soon as possible. |
Signed-off-by: Princee215 <princeesingh215@gmail.com>
64a1abe
to
d76d243
Compare
Great Work @Princee215 👍 |
As mentioned in #145 issue. All the OpenSUSE data files that are being generated have an empty JSON file, that was due to a buggy code that Arsh and I tried to correct. We use to have separate chunk of code for creation of different files, In this PR I've use nested for loop and try to reduce down the repetition and the lines of code.
Once this get a green flag, I'll subsequently update the data files in the data repository that are empty right now.
@pleia2 and @arshPratap please take a look and let me know if there's anything that needs to be done.