ignore: add coverage.xml, produced by tox
ignore: add *.bak
Merge pull request #89 from mgeisler/ignore

Update ignore file (ignore coverage.xml, *.bak)
tox: explicitly test with Python 3.2 and 3.3

We've had a number of issues with subtle differences between Python
version 3.2 and 3.3. Python 3.2 is what Jenkins had installed (it's
part of Ubuntu 12.04 LTS) and Python 3.3 is what Lars and I had
installed locally.

We've now installed Python 3.3 on Jenkins as well and can thus
explicitly add test coverage to that version. Older and newer versions
of Python for Ubuntu can be found here:

  https://launchpad.net/~fkrull/+archive/deadsnakes

For Debian, you can enable more than one distribution at the same
time, e.g., enabling wheezy and jessie (testing) at the same time.

If you don't have all the Python versions installed, tox will report
this in the summary:

  $ tox
  # ...
    py27: commands succeeded
  ERROR:   py32: InterpreterNotFound: python3.2
    py33: commands succeeded
    pep8: commands succeeded
    pyflakes: commands succeeded
    full: commands succeeded
    doc: commands succeeded

This should make it clear for contributors exactly which Python
versions we support.
tox: add Python 3.4 as a supported version
tox: add Python 2.6 as a supported version

This required some minor changes: tarfile.open doesn't work as a
context manager in that version and there is no stdlib OrderedDict.
README: document supported Python versions
Merge pull request #90 from mgeisler/test-more-python-versions

Support/test more python versions; now 2.6, 2.7, 3.2, 3.3, and 3.4.
setup: make Python version classifiers more generic

We now support a wide range of 2.x and 3.x versions, so I don't think
we need to list the specific versions any longer.

Furthermore, websites such as http://python3wos.appspot.com/ monitor
the 'Programming Language :: Python :: 3' tag to report on the support
for Python 3.
readme: add build status icon
Merge pull request #91 from mgeisler/misc-doc-fixes

Small doc fixes
tests: add cram dependency

Cram is a tool for testing command line programs:

  https://bitheap.org/cram/

This allows us to do whole-system testing of zpm.

Cram 0.6 doesn't support Python 3.2. I fixed this and made a pull
request for getting the fix into upstream, but until this happens we
can depend on my fork.
zpm: handle invocation with no subcommand

Invoking zpm under Python 3 resulted in

   $ zpm
   Traceback (most recent call last):
     File "/home/mg/src/zpm/.tox/py3/bin/zpm", line 27, in <module>
       args.func(args)
   AttributeError: 'Namespace' object has no attribute 'func'

The problem is that argparse returns an empty Namespace in Python 3
when none of the subparsers match -- subparsers are seen as optional
in Python 3, but not in Python 2.
setup: include templates as package data

The templates were not packaged and thus also not installed. This
meant that running 'zpm new' failed with:

  jinja2.exceptions.TemplateNotFound: zar.yaml

The error only occurs if the zpm package is installed normally,
creating a link with 'pip install -e .' hides the error.
commands: RuntimeError has no message attribute in Python 3

This would trigger the following traceback if one tried to run 'zpm
new foo' and foo/zapp.yaml already existed:

  $ python3 zpm new foo
  Traceback (most recent call last):
    File "/home/mg/src/zpm/zpmlib/commands.py", line 86, in new
      zappyaml = zpm.create_project(args.dir)
    File "/home/mg/src/zpm/zpmlib/zpm.py", line 52, in create_project
      return _create_zapp_yaml(location)
    File "/home/mg/src/zpm/zpmlib/zpm.py", line 72, in _create_zapp_yaml
      raise RuntimeError("'%s' already exists!" % filepath)
  RuntimeError: 'foo/zapp.yaml' already exists!

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "zpm", line 23, in <module>
      args.func(args)
    File "/home/mg/src/zpm/zpmlib/commands.py", line 88, in new
      print(err.message)
  AttributeError: 'RuntimeError' object has no attribute 'message'
bundle: only encode shlex.split arg on Python 2.x

Before, we would encode all str objects to bytes objects, and this
causes an error in Python 3:

  >>> shlex.split(b'foo bar baz')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3.3/shlex.py", line 276, in split
      return list(lex)
    File "/usr/lib/python3.3/shlex.py", line 266, in __next__
      token = self.get_token()
    File "/usr/lib/python3.3/shlex.py", line 93, in get_token
      raw = self.read_token()
    File "/usr/lib/python3.3/shlex.py", line 121, in read_token
      nextchar = self.instream.read(1)
  AttributeError: 'bytes' object has no attribute 'read'
bundle: use io.BytesIO for tar.addfile in Python 3

In Python 2, tar.addfile works with StringIO, but in Python 3 it needs
a io.BytesIO object instead.
bundle: add system tests

These tests verify the behavior patched in 06aa7e094db1 and
c86d7b5cb868.