Migrate SDF download function from ckanext-downloadsdf

Migrate the Simple Data Format download plugin from
https://github.com/ckan/ckanext-downloadsdf (implemented by @joetsoi)
into this extension.

Keep it as a separate plugin that can be used on its own, but move it
into this extension for code sharing purposes (utility functions, but
especially test and coverage framework).

Tests have not been migrated yet.
Migrate SDF download tests from ckanext-downloadsdf

Original code by @joetsoi migrated from
https://github.com/ckan/ckanext-downloadsdf
Fix a crash on resources with no files

The Simple Data Format Download button should not crash for resources
that don't have files uploaded to the FileStore.
Handle resources without uploaded files

When generating the Simple Data Format JSON and ZIP file, handle
resources that have files uploaded to the FileStore by putting a
"path" in the JSON and putting the file into the ZIP. Handle resources
that don't have an uploaded file by putting "url" in the JSON. Needs
tests.
Add tests for inlining CSV files in ZIP files
Fix a docstring
Add a test that the download button is rendered correctly
Merge branch 'master' into sdf-download

Conflicts:
	ckanext/b2/plugin.py
	ckanext/b2/templates/base.html
	ckanext/b2/templates/datapackager_ckan_theme/base.html
	ckanext/b2/templates/datapackager_ckan_theme/footer.html
	ckanext/b2/templates/datapackager_ckan_theme/header.html
	ckanext/b2/templates/datapackager_ckan_theme/index.html
	ckanext/b2/templates/datapackager_ckan_theme/package/base.html
	ckanext/b2/templates/datapackager_ckan_theme/package/base_form_page.html
	ckanext/b2/templates/datapackager_ckan_theme/package/edit_base.html
	ckanext/b2/templates/datapackager_ckan_theme/package/new.html
	ckanext/b2/templates/datapackager_ckan_theme/package/new_package_form.html
	ckanext/b2/templates/datapackager_ckan_theme/package/read.html
	ckanext/b2/templates/datapackager_ckan_theme/package/read_base.html
	ckanext/b2/templates/datapackager_ckan_theme/package/resource_edit_base.html
	ckanext/b2/templates/datapackager_ckan_theme/package/resource_read.html
	ckanext/b2/templates/datapackager_ckan_theme/package/resources.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/info.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/package_basic_fields.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/package_form.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/package_metadata_fields.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/resource_edit_form.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/resource_form.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/resource_help.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/resource_info.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/resource_item.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/resources.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/resources_list.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/stages.html
	ckanext/b2/templates/datapackager_ckan_theme/package/snippets/tags.html
	ckanext/b2/templates/datapackager_ckan_theme/snippets/social.html
	ckanext/b2/templates/datapackager_ckan_theme/snippets/tag_list.html
	ckanext/b2/templates/datapackager_ckan_theme/user/login.html
	ckanext/b2/templates/datapackager_ckan_theme/user/new.html
	ckanext/b2/templates/datapackager_ckan_theme/user/new_user_form.html
	ckanext/b2/templates/datapackager_ckan_theme/user/read.html
	ckanext/b2/templates/datapackager_ckan_theme/user/read_base.html
	ckanext/b2/templates/footer.html
	ckanext/b2/templates/header.html
	ckanext/b2/templates/home/index.html
	ckanext/b2/templates/package/base.html
	ckanext/b2/templates/package/base_form_page.html
	ckanext/b2/templates/package/edit_base.html
	ckanext/b2/templates/package/new.html
	ckanext/b2/templates/package/new_package_form.html
	ckanext/b2/templates/package/read.html
	ckanext/b2/templates/package/read_base.html
	ckanext/b2/templates/package/resource_edit_base.html
	ckanext/b2/templates/package/resource_read.html
	ckanext/b2/templates/package/resources.html
	ckanext/b2/templates/package/snippets/info.html
	ckanext/b2/templates/package/snippets/package_basic_fields.html
	ckanext/b2/templates/package/snippets/package_form.html
	ckanext/b2/templates/package/snippets/package_metadata_fields.html
	ckanext/b2/templates/package/snippets/resource_edit_form.html
	ckanext/b2/templates/package/snippets/resource_form.html
	ckanext/b2/templates/package/snippets/resource_help.html
	ckanext/b2/templates/package/snippets/resource_info.html
	ckanext/b2/templates/package/snippets/resource_item.html
	ckanext/b2/templates/package/snippets/resources.html
	ckanext/b2/templates/package/snippets/resources_list.html
	ckanext/b2/templates/package/snippets/stages.html
	ckanext/b2/templates/package/snippets/tags.html
	ckanext/b2/templates/snippets/social.html
	ckanext/b2/templates/snippets/tag_list.html
	ckanext/b2/templates/user/login.html
	ckanext/b2/templates/user/new.html
	ckanext/b2/templates/user/new_user_form.html
	ckanext/b2/templates/user/read.html
	ckanext/b2/templates/user/read_base.html
	ckanext/datapackager/logic/action/get.py
	ckanext/datapackager/templates/base.html
	ckanext/datapackager/templates/footer.html
	ckanext/datapackager/templates/header.html
	ckanext/datapackager/templates/home/index.html
	ckanext/datapackager/templates/package/base.html
	ckanext/datapackager/templates/package/base_form_page.html
	ckanext/datapackager/templates/package/edit_base.html
	ckanext/datapackager/templates/package/new.html
	ckanext/datapackager/templates/package/new_package_form.html
	ckanext/datapackager/templates/package/read.html
	ckanext/datapackager/templates/package/read_base.html
	ckanext/datapackager/templates/package/resource_edit_base.html
	ckanext/datapackager/templates/package/resource_read.html
	ckanext/datapackager/templates/package/resources.html
	ckanext/datapackager/templates/package/snippets/info.html
	ckanext/datapackager/templates/package/snippets/package_basic_fields.html
	ckanext/datapackager/templates/package/snippets/package_form.html
	ckanext/datapackager/templates/package/snippets/package_metadata_fields.html
	ckanext/datapackager/templates/package/snippets/resource_edit_form.html
	ckanext/datapackager/templates/package/snippets/resource_form.html
	ckanext/datapackager/templates/package/snippets/resource_help.html
	ckanext/datapackager/templates/package/snippets/resource_info.html
	ckanext/datapackager/templates/package/snippets/resource_item.html
	ckanext/datapackager/templates/package/snippets/resources.html
	ckanext/datapackager/templates/package/snippets/resources_list.html
	ckanext/datapackager/templates/package/snippets/stages.html
	ckanext/datapackager/templates/package/snippets/tags.html
	ckanext/datapackager/templates/snippets/social.html
	ckanext/datapackager/templates/snippets/tag_list.html
	ckanext/datapackager/templates/user/login.html
	ckanext/datapackager/templates/user/new.html
	ckanext/datapackager/templates/user/new_user_form.html
	ckanext/datapackager/templates/user/read.html
	ckanext/datapackager/templates/user/read_base.html
	ckanext/datapackager/tests/controllers/test_package.py
	ckanext/datapackager/tests/helpers.py
	setup.py
Merge branch 'master' into sdf-download

Conflicts:
	ckanext/datapackager/controllers/package.py
	ckanext/datapackager/logic/action/get.py
	ckanext/datapackager/tests/controllers/test_package.py