Skip to content
Snippets Groups Projects
  1. May 07, 2016
  2. May 04, 2016
  3. Apr 28, 2016
  4. Apr 20, 2016
    • Adam Williamson's avatar
      add 'end' arg for PageList · ac33283e
      Adam Williamson authored
      this is sometimes useful; for instance I have a use case for
      getting all pages in a given namespace that are alphabetically
      between two specific points (because their names are in a
      predictable format that involves alphabetically-sorted dates).
      'end' is added as the last kwarg to avoid breaking any current
      uses that rely on the kwarg ordering (thanks dan for pointing
      that out).
      ac33283e
  5. Mar 01, 2016
  6. Feb 09, 2016
  7. Feb 06, 2016
  8. Feb 05, 2016
  9. Feb 03, 2016
    • Adam Williamson's avatar
      [#106] fix GeneratorList with Python 3 (add __next__) · 7522c02b
      Adam Williamson authored
      Credit for this fix goes to @tosher:
      https://github.com/mwclient/mwclient/issues#issuecomment-154751657
      I just figured out exactly what changes his comment suggested,
      and poked around a bit to figure out what was going on and why
      they're needed.
      
      `GeneratorList` (and things deriving from it, e.g. `Category`)
      was broken for iteration purposes in Python 3. In Python 3
      the iterator protocol requires a `__next__` method, not a `next`
      method as in Python 2. 8d0650cd renamed `List`'s `next` method
      to `__next__` and added a small wrapper `next` method to account
      for this, but did not make the same change for `GeneratorList`.
      So when you iterate over a `GeneratorList` with Python 3, it
      winds up calling `List.__next__` (since `GeneratorList` inherits
      from `List`), not `GeneratorList.next`. So we don't hit the bit
      that turns the results into mwclient page objects, and just get
      the raw dicts from the `List` method.
      
      We also have to change a couple of direct calls to `List.next`
      to call `List.__next__` instead. If we don't do this, then when
      the call originates from a child class, things get messed up,
      because `List.next` calls `self.__next__` - and that will wind
      up calling the child class' `__next__`, not `List`'s `__next__`.
      
      Confused yet? :)
      7522c02b
  10. Jan 23, 2016
  11. Jan 22, 2016
  12. Jan 10, 2016
  13. Nov 17, 2015
  14. Nov 10, 2015
  15. Nov 09, 2015
  16. Sep 27, 2015
  17. Sep 19, 2015
    • Adam Williamson's avatar
      optionally, cache page text until next edit operation · e8fc54d9
      Adam Williamson authored
      Store the results of page.text() operations in a simple cache
      dict. This avoids unnecessary remote roundtrips. Cache is
      cleared on each successful page.save() operation. cache
      argument can be set to 'False' to disable use of the cache.
      e8fc54d9
  18. Sep 12, 2015
  19. Aug 29, 2015
    • Dan Michael O. Heggø's avatar
      Update release notes with #81 · dffd7baf
      Dan Michael O. Heggø authored
      dffd7baf
    • Adam Williamson's avatar
      Drop Page.section attribute · ee30ef6c
      Adam Williamson authored
      This attribute goes back to an older design, where
      the 'edit page' workflow was different: the edit() method did
      part of the work of defining what text you meant to edit. In
      the current workflow, text() - which replaced the deprecated
      edit() - is only for retrieving text, and save() is supposed
      to do all the work of editing the page.
      
      The 'section' attribute is therefore obsolete and dangerous.
      ee30ef6c
  20. Aug 24, 2015
Loading