Skip to content
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

Maintainance and Readability issues in this repo #1

Closed
Thirumal-Palwai opened this issue May 10, 2022 · 5 comments
Closed

Maintainance and Readability issues in this repo #1

Thirumal-Palwai opened this issue May 10, 2022 · 5 comments

Comments

@Thirumal-Palwai
Copy link

  1. Can we give some meaningful names and provide comments to make this code readable?
  2. I could also see this code is not catching errors (try: catch:) for the regular errors. (example: GitHub Api Current quota exhausted)
  3. Can we update README.md to make it more meaningful. you can add descriptions of inputs and outputs.
  4. I'm having issues with the script - is the code incomplete? can you provide more examples with different organizations and repos?

Traceback (most recent call last):
File "C:\Users\320167839\Downloads\githubapi-main\githubapi-main\api.py", line 19, in
data = json.loads(rjson)
File "C:\Python310\lib\json_init_.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not list

  1. Can we stick to the requirement. to provide only specifics asked?
@Krishnaveni-KV
Copy link
Owner

  1. tried providing the comments in code for readable
  2. permission issues with results.json file for executing the code.
  3. i added basic information in the README.md file for basic understand
  4. script is printing the inputs but not able to print output due to permission denied issue. Results.json file is validated file. attached screenshot for your reference.

5.Kindly check the results.json for the output manually. in the
Code execusion issues.docx
script still working for the results.

@Thirumal-Palwai
Copy link
Author

please do not close the issues before addressing

The sample that I tried:
$ python api.py
Enter Organisation name : philips-software
Enter the Repo name : app-token-action

Error that I'm facing: 26th line is not intended Properly

even after correcting I got new isuues

359">actions/setup-node#359).

\n'
'

In the previous behaviour we relied on stderr '
'output to throw error. The warning messages from package managers '
"can be written to the stderr's output. For now the action will "
'throw an error only if exit code differs from zero. Besides, we add '
Traceback (most recent call last):
File "D:\New folder\githubapi\api.py", line 28, in
pprint(r.json())
File "C:\Python310\lib\pprint.py", line 55, in pprint
printer.pprint(object)
File "C:\Python310\lib\pprint.py", line 152, in pprint
self._format(object, self._stream, 0, 0, {}, 0)
File "C:\Python310\lib\pprint.py", line 180, in _format
p(self, object, stream, indent, allowance, context, level + 1)
File "C:\Python310\lib\pprint.py", line 237, in _pprint_list
self._format_items(object, stream, indent, allowance + 1,
File "C:\Python310\lib\pprint.py", line 449, in _format_items
self._format(ent, stream, indent,
File "C:\Python310\lib\pprint.py", line 180, in _format
p(self, object, stream, indent, allowance, context, level + 1)
File "C:\Python310\lib\pprint.py", line 216, in _pprint_dict
self._format_dict_items(items, stream, indent, allowance + 1,
File "C:\Python310\lib\pprint.py", line 387, in _format_dict_items
self._format(ent, stream, indent + len(rep) + 2,
File "C:\Python310\lib\pprint.py", line 180, in _format
p(self, object, stream, indent, allowance, context, level + 1)
File "C:\Python310\lib\pprint.py", line 317, in _pprint_str
write(rep)
File "C:\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0441' in position 10: character maps to

@Thirumal-Palwai
Copy link
Author

comments in your code are too heavy. can you balance them?
naming conventions are not followed still!

still working for the results --> if that is the case please keep the issue open

@Krishnaveni-KV
Copy link
Owner

yeah, sure I will work on codes comments.,

Can you please check, while i am running in the python online compiler, I am facing the permission issues, user prospective may be the permissions issue, if admin side we can try. I tried many times but still stuck in the permissions. please check the attached file.

snapshot.docx
Can you please help me on this?

@Krishnaveni-KV
Copy link
Owner

I taken my own repository issues, and given input parameters like org name: Krishnaveni-KV and repo name as: githubapi
Output got printed in the
Assigned Task.docx
terminal by using shell script in vi editor. Attached word file for your reference.

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

No branches or pull requests

2 participants