Email and IRC build notifications

Always send build notifications to pywikibot-commits@lists.wikimedia.org
as even successes may have slightly different output, and the build
email signals that the build is completed.

Only notify IRC on changes, and reduce the IRC build notice to one
message which will wrap onto two lines.

Change-Id: I5cc6e11e6bf5ecb2da83f9b1c4d5c40ea9caa694
Remove user messages check during startup

19703ab10826fdcd47c683d27ffe1ca1b2af0ac8 added a check to prevent
user login during initalisation in order to log whether the user
has unread messages on their talk page.

The check used Site.logged_in, however that method will always be
false at initialisation as _userinfo has not been fetched.
(site.py:682 of https://mediawiki.org/wiki/Special:Code/pywikipedia/10285)

Moving the user talk check to 'after' Site.login would complicate
the login sequence, and has little benefit.  A more comprehensive
implementation is needed.  So remove it for now, as it hasnt worked
for a while.

Bug: 69895
Change-Id: Id2c2321a8ebdd4edccb6c6f1731d7461dfd4fbd9
Category.py: upcast from Page to Category

Instantiate directly a Category, instead of a Page with ns=14.

Change-Id: Iff7d591c0877140fa50c4a939e5430bf44c4d21b
Change Site.ns_index() return type from int to Namespace

Adds Namespace operators mod, add, sub to support
existing use of returned value in algorithms.

Change-Id: Iffe4d65ac4bd9ed7f76ec22922baae18a8428ebb
Export sys.path to pwb scripts

setup.py can install packages, which are available within the
unit tests as it adds the packages to sys.path.

script_tests needs to export sys.path into the script environment
so these packages may be imported by the script.

Also move a docstring which was incorrectly placed inside the method
procedure.

Bug: 71864
Change-Id: I6356b4b5d8da7529957befe8157f78457ebb5df1
Fix ScriptTest metaclass super __new__

Attributes like 'user' and 'net' have not been set on script tests
as the metaclass did not invoke the super meta-classes' __new__.

Change-Id: Ied762af1fb2099a3fb4f906306068546ebb99606
welcome.py -limit parameter wasn't taken into account.

Actual correction is courtesy of xzise @ #pywikibot

Change-Id: I28b23c8866f81f7a1f3de2202f5754104baa2563
Use unittest 0.6.0

Unittest 0.7+ is going to behave like unittest from Python 3.4,
which is that expectedFailure's must fail, which is different
from Python 2.7 and 3.3 unittest.

https://code.google.com/p/unittest-ext/issues/detail?id=85

Bug: 72801
Change-Id: I7480b6021c76aa4383140e229b6c877a6833a7ef
Allow github clones to easily run travis builds

The wiki user 'Pywikibot-test' only works on the 'wikimedia'
travis-ci account.  This prevents unmodified clones of the
codebase from running tests on travis-ci.

The tests now run according to whatever is in user-config.py,
skipping tests which cant be run.

The default .travis.yml now detects if it is run by the 'wikimedia'
account, and detects if the travis user has a password set.

If a username or password can't be found, the username and password
are not set up, which disables any tests which require a user.

Change-Id: I0f22caaf8b5cd314a196a5e3cc25ae830231ccb5
Merge "Export sys.path to pwb scripts"
Merge "Fix ScriptTest metaclass super __new__"
Merge "welcome.py -limit parameter wasn't taken into account."
Replace useless string with FIXME

Change-Id: I208b9f20c7820804d83a73262a251de17b106397
[FIX] Secure python-eggs directory

The python-eggs directory created with Travis was insecure which
generated warnings and were treated as errors by the script tests.

Change-Id: I181cb9ae372a5ba65ee6f89c8e91e29dfe6d6bc9
Merge "[FIX] Secure python-eggs directory"
Allow ThreadGenerator param target to be iterable

Detech if the param 'target' is iterable, and use it without
calling it first.

Included also basic tests.

Change-Id: I02152fdbc8e32f4677fb839f18282350034a329e
Remove unused Family.content_id

content_id is used in compat, for non-API access to mediawiki, which
is functionality that exists in core.
If core ever needs to support pre-1.13 editing, this and many other
parts of compat will need to be extensively mined for implementation
details like this.  We know where to find this.  It doesnt need to
be in core Family.

Change-Id: Ib3111eba7c16782a68646f34b540062486e17e6e
Porting us-script.py

Renamed to states-redirect.py as it covers more than US States.
Sub-divisions used for all countries using pycountry
Created a bot class function for us-states.py for subdivisions

Change-Id: I2b49afce96a801ab92a2e5656144ed4ee3deadc1
Merge "Porting us-script.py"
Merge "Allow ThreadGenerator param target to be iterable"