Implement a preloading generator for ItemPages

Since it becomes near impossible to find which specific
item lines up with which original page object, we just
create new objects and yield those.

WikibasePage.__defined_by had to be renamed so it is
no longer a private method.
Change-Id: I05917eb982f41dcdc92d8e45292ba6c27eac47f7
Support for fetching page properties

Added a convenience function for fetching
the defaultsort value.

Change-Id: I0752f1560e0e93cba0e01a9a1ea834e35f8a725c
If we already have pageproperties, use it for ItemPage.fromPage

The Wikibase Id is stored in the pageproperties, so lets use
it if we can.

Change-Id: I1a4a7d4235bd4e3717f0e6248ab90f10460f264b
login.py: use site.code instead of site.lang

The code used for the site is not necessary the same as the language -
this is clear for instance for commons (site.code = 'commons',
site.lang = 'en') and wikidata.

Changing this means logging in works for people using
    mysite = 'wikidata'; family = 'wikidata'

where before this resulted in a cryptic
    en.wikidata is not a valid site, please remove it from your config
error message.

Change-Id: I978437feb4862a7f1fc688fcd9ba4dee6d315c67
Merge "Implement a preloading generator for ItemPages"
Limit ItemPage preloading to existing pages

[[d:Q6]] does not exist, so just go up to and including [[d:Q5]].

Change-Id: I712d0138529af20dd1c88c726aa1122ae3567b46
Make return value of defaultsort more explicit

In a seperate commit to prevent a big rebase mess.

Change-Id: I5300844e8c992014ecb13e9eaa77cdc56e1678b5
Merge changes I1a4a7d42,I0752f156

* changes:
  If we already have pageproperties, use it for ItemPage.fromPage
  Support for fetching page properties
Merge "Make return value of defaultsort more explicit"
Function to check whether a site has a certain extension loaded

Change-Id: I0fc57f974b19da5d929f119f759f5cd6d56c5e43
update language_by_size from compat

Change-Id: I8669a059f59f2bd62d086bfa21082607dd3c1621
ignore logs, data and cache dirs, password file, backup files, throttle file, user-config and user-fixes

Change-Id: I603735817728724dc826e8adb92c09ece5a62c60
Suggest git.wikimedia.org as httplib2 download site

See Wieland Hoffmanns mail [1] for more details; this should prevent
setup.py install from installing an non-functional httplib2 (that
is: one with outdated SSL certificated)

[1] http://article.gmane.org/gmane.comp.python.pywikipediabot.general/13432

Change-Id: Ia0f91237dde1565a6dd71206c2e0477690cf3855
Merge "Suggest git.wikimedia.org as httplib2 download site"
Merge "login.py: use site.code instead of site.lang"
Random commit to see how pulling changes this.