Page MenuHomePhabricator

document pywikibot.error and pywikibot.exception
Closed, ResolvedPublic

Event Timeline

valhallasw raised the priority of this task from to Needs Triage.
valhallasw updated the task description. (Show Details)
valhallasw added a subscriber: valhallasw.

Note this is not about pywikibot.Error ;-)

By "document" what do you mean ? Where should this be documented ? What sort of information additionally should be added ?

I clearly should have written a better bug report, because I can't reproduce the exact point ;-)

This is about the functions 'error' and 'exception' in https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/logging.py.

def output documents the meaning of the various parameters, but all of the other logging functions (def error, but also e.g. def warning, which was not mentioned in the bug title) are missing the extended documentation. That documentation should be added.

Xqt triaged this task as Lowest priority.Sep 5 2018, 4:29 PM
Xqt added a project: good first task.

I am on it @valhallasw . I have documented the warning( ). Soon will take up the rest non-documented functions.
Thanks for reporting.

I am on it @valhallasw . I have documented the warning( ). Soon will take up the rest non-documented functions.
Thanks for reporting.

Hello, you made a pull request to GitHub repository mirror. Please see my comment there to make a correct pull request on Gerrit repository

I'm unable to access /sign into my Gerrit account. Need some help.

Is there anyway to contribute through GitHub ?

So why not start a new account? Or try the patch uploader I linked to?

I tried the latter one, but not fruitful.
Is there a way to contribute via GitHub?

Thanks @Dvorapa will figure it out on my own.

If any help needed, ask here, in the mailing list or on IRC chat

@Dvorapa Could you please have a look over my pushed change .

@valhallasw Sorry for the great delay, I have pushed the code . Would be great if you suggest any changes.

We reviewed your work there, please fix the issues!

Hi @Dvorapa
Thanks for your patience. Could you please look over my commit ?

There are multiple errors you should fix. I and @valhallasw gave you ideas what to fix there. Also there are errors reported by jenkins bot. We are waiting for your fixes :)

Change 486715 had a related patch set uploaded (by Xqt; owner: Kaushik Reddy):
[pywikibot/core@master] Re-added the warning() documentation

https://gerrit.wikimedia.org/r/486715

Change 486715 merged by jenkins-bot:
[pywikibot/core@master] Re-added the warning() documentation

https://gerrit.wikimedia.org/r/486715

Hi @Dvorapa
Thanks for your patience. Could you please look over my commit ?

Your commit was briefly edited and merged, thank you for your struggle with Gerrit and see you later!

@Urstrulykkr: Thanks for your patch. All Gerrit patches merged, can this task be closed as resolved (you can do that via Add Action...Change Status in the dropdown menu) or is there more work to do?

@Aklapper error and exception still need better docs

Hi guys,

That's so good to hear.
I think I will close it. Thanks for the update :)

Best,
Kaushik.

error and exception still need better docs

In that case I am resetting the assignee of this task as it seems that @Urstrulykkr does not plan to work on these parts (please correct me if I am wrong!).

I would like to work on this task. So, would somebody guide me on how to proceed with solving this?

@Homeboy_445: pywikibot.logging has several output methods: output(), stdout(), warning(), error(), log(), critical(), debug() and also exception(). The doc strings might be improved, particulary the difference of error() and exception(). All functions are similar to the logging buildins: https://docs.python.org/3/library/logging.html?highlight=exception#logging.exception

@Xqt So do I have to enhance the documentation of pywikibot.logging particularly the error and the exception functions and their description is the same as the python docs and What do you mean by the difference between error() and exception() do I explicitly have to provide the actual difference between the error and exception or something else?

This comment was removed by Homeboy_445.

Please help me I'm a little confused with this task!

Please help me I'm a little confused with this task!

I think expanding the doc strings in logging.stdout, error, log, critical, debug and exception will solve it. Use logging.warning as a sample. Take care that logging.exception is different from the othes. In addition also be inspired from similar functions in https://docs.python.org/3/library/logging.html

Thanks a lot for your help I'll look forward to solving it!

@Xqt I'm done with the task but stuck with a problem. I accidentally pushed my changes to the last branch I created for the previous issue I've worked upon. So, What should I do now?

@Xqt I'm done with the task but stuck with a problem. I accidentally pushed my changes to the last branch I created for the previous issue I've worked upon. So, What should I do now?

Can't see any changes at your last patch https://gerrit.wikimedia.org/r/c/pywikibot/core/+/638097
So try the following steps:

  1. create a new patch at your current accidentally pushed patch
  2. rebase it onto master
  3. push it to gerrit repository
  4. switch/checkout to your current accidentally pushed
  5. fetch the old patch from gerrit repository
  6. cherry-pick FETCH_HEAD
  7. make the needed changes
  8. commit it and push it to gerrit

@Xqt Thanks a lot for your help again! :D

@Xqt: Well, I have resolved the issue, fortunately. Please check if the made changes have met your expectations or not. Thank you!

Change 640171 had a related patch set uploaded (by Xqt; owner: Homeboy 445):
[pywikibot/core@master] [doc] Improved doc string for logging.py function

https://gerrit.wikimedia.org/r/640171

Xqt assigned this task to Homeboy_445.

Change 640171 merged by Xqt:
[pywikibot/core@master] [doc] Improved doc string for logging.py function

https://gerrit.wikimedia.org/r/640171