Page MenuHomePhabricator

GSoC: Pywikibot-Thanks | Meeting 4 | 3rd June
Closed, ResolvedPublic


| Friday, 3rd June 2016 - 15:30 UTC
| jayvdb, darthbhyrava
{Icon user} legoktm did not attend

IRC Chat
Description: Second weekly project meeting.
Start: 15.30 UTC
End: 17.00 UTC

Minutes of the Meeting


Design for Code

A rough sketch of the code I want to add to Please see T136892#2353272

  • This is not what was described in T135409, we are not building a bot here, we are writing code that others will use in their bots.

To stay on track, I must ignore the class diagrams etc, as I don't have it yet, and jump straight into coding. By next Wednesday morning, create a proof of concept that sends thanks to the server for an edit on for this edit. Ignore all design. Create a hack that works. Write code and send it via email if necessary. Hard code anything, interact with anything. Just get it to work.

If you only have a great design by next Friday, and no working code, the project is off track, but if you have working code, and a poor design by next Friday, that is something we can improve in the following week. Once I've sent jayvdb a proof of concept for thanks, spend a day working on getting to write to .

Queries regarding,

Refer to the corresponding blog post here. The doubts (jayvdb's answers are in italics) are as follows:

  • What is the live wiki here? See pywikibot.handle_args for site selection , and for site configuration
  • What is the depth in issue_deprecation_warning? Stack level. The deprecation message will print a line of source code, changing depth will change the code printed.
  • What is the Options variable? How are they using self.availableOptions.update without defining or calling it? It's magic, we'll look at it later in weeks 5 and 6. :)
  • Why do we import unicode_literals? It means every string is unicode, not ascii. Python 2 was ascii by default, and u'...' created unicode strings. Unicode_literals says we want the python 3 default of unicode strings, and we will use b'....' if we want ascii.
  • Why are we importing 'partial'? functools.partial is a core component of python, and well documented online. Google it up.
  • What was the point of this conditional block? " if sys.version_info[0] > 2: ... " Google up sys.version_info.
  • What are T001 tests in tox.ini? T001 & T003 : See here. flake8-print is a code checker.
  • What is memento? Google up, again, but only the basics.
Unit Testing

Doubts I had based on what I'd read, and plan for the next week.

  • Shouldn't I write a method first, perform unit tests for it, and then proceed to the next method to be written? How do I 'start' with unit_tests? You can write the unit tests first , or while you write the rest of your code. The former is better engineering.
  • Where should I write my unit tests? In tests/

Create test module, called tests/ . Read tests/README.rst , and read tests/ to see a nice simple example. I have written tests/, but that was a test which didnt talk to the network, and doesnt have a 'site'. Here, though, will need to talk to the wiki. Getting my first unit test working will be hard, and I'll probably need me to tell you how to fix the last 5% of it. Once I have one unit test written, I'll be able to replicate it and it will be easy after that.

Closing the Community Bonding Evaluation task.

T133666 was closed, after unticking some progress checkers which were left incomplete. Clarifications as to why they were unticked ensued.

Before next Meet:
  • Redo design mentioned in T136892#2353272 in accordance with T135409. (See new design at T136892#2374804)
  • Create the proof of concept which send thanks to server for this edit. ( Check P3234)
  • Get to write to
  • Read tests/README.rst and tests/
  • Create tests/ (Please see here.
  • Update blog. Done, see name
  • Update weekly progress report.

Event Timeline

The basic design to be elaborated upon:

class ThankBot( SingleSiteBot ):
""" Code for the different functionalities of the bot """

    def thank_rev( revision object ):
    """ A method which will take a revision object, extract the revision to be thanked, and then thank it on behalf of ThankBot"""

I note with extreme annoyance that these minutes were only added today, on the day of the next scheduled meeting, and not added on Monday/Tuesday as described at E199. Please stick to the schedule, or advise us early if you can not keep the schedule.

But, thank you for once again writing good meeting minutes. Accepted.

The corrected design to be added to scripts/

def thank_rev( revision_id ):
     """ A method which will take a revision_id, and make an thank API call for it on behalf of the user logged in"""
    #Login to site
    # API Call to get token
    # API Call to use the token to thank the revision

def main(*args):
    "Take arguments, parse them, and call thank_rev()"""