diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 3138593..0000000 --- a/.coveragerc +++ /dev/null @@ -1,5 +0,0 @@ -[report] -omit = - */site-packages/* - */python?.?/* - ckan/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6e52d42..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: python -python: - - "2.6" - - "2.7" -env: PGVERSION=9.1 -install: - - bash bin/travis-build.bash - - pip install coveralls -script: sh bin/travis-run.sh -after_success: - - coveralls diff --git a/MANIFEST.in b/MANIFEST.in index 78362c3..f23f24b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -include README.rst -recursive-include ckanext/officedocs *.html *.json *.js *.less *.css \ No newline at end of file +include README.md +recursive-include ckanext/officedocs *.html *.json *.js *.less *.css diff --git a/bin/travis-build.bash b/bin/travis-build.bash deleted file mode 100644 index d60b792..0000000 --- a/bin/travis-build.bash +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -set -e - -echo "This is travis-build.bash..." - -echo "Installing the packages that CKAN requires..." -sudo apt-get update -qq -sudo apt-get install postgresql-$PGVERSION solr-jetty libcommons-fileupload-java:amd64=1.2.2-1 - -echo "Installing CKAN and its Python dependencies..." -git clone https://github.com/ckan/ckan -cd ckan -git checkout release-v2.2 -python setup.py develop -pip install -r requirements.txt --allow-all-external -pip install -r dev-requirements.txt --allow-all-external -cd - - -echo "Creating the PostgreSQL user and database..." -sudo -u postgres psql -c "CREATE USER ckan_default WITH PASSWORD 'pass';" -sudo -u postgres psql -c 'CREATE DATABASE ckan_test WITH OWNER ckan_default;' - -echo "Initialising the database..." -cd ckan -paster db init -c test-core.ini -cd - - -echo "Installing ckanext-ckanext-gdoc and its requirements..." -python setup.py develop -pip install -r dev-requirements.txt - -echo "Moving test.ini into a subdir..." -mkdir subdir -mv test.ini subdir - -echo "travis-build.bash is done." \ No newline at end of file diff --git a/bin/travis-run.sh b/bin/travis-run.sh deleted file mode 100644 index 73b501f..0000000 --- a/bin/travis-run.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -e - -echo "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" | sudo tee /etc/default/jetty -sudo cp ckan/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml -sudo service jetty restart -nosetests --nologcapture --with-pylons=subdir/test.ini --with-coverage --cover-package=ckanext.gdoc --cover-inclusive --cover-erase --cover-tests \ No newline at end of file diff --git a/ckanext/officedocs/plugin.py b/ckanext/officedocs/plugin.py index f1e5ec5..060777e 100644 --- a/ckanext/officedocs/plugin.py +++ b/ckanext/officedocs/plugin.py @@ -19,8 +19,8 @@ def info(self): "name": "officedocs_view", "title": tk._("Office Previewer"), "default_title": tk._("Preview"), - "icon": "compass", - "always_available": True, + "icon": "windows", + "always_available": False, "iframed": False, } @@ -32,13 +32,17 @@ def setup_template_variables(self, context, data_dict): def can_view(self, data_dict): supported_formats = [ - "DOC", "DOCX", "XLS", "CSV", + "DOC", "DOCX", "XLS", "XLSX", "XLSB", "PPT", "PPTX", "PPS", "PPSX", "ODT", "ODS", "ODP" ] try: - res = data_dict["resource"].get("format", "").upper() - return res in supported_formats + pkg_private = data_dict["package"].get("private", False) + if not pkg_private: + res = data_dict["resource"].get("format", "").upper() + return res in supported_formats + else: + return False except: return False diff --git a/setup.py b/setup.py index a550515..47f23ef 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # http://packaging.python.org/en/latest/tutorial.html#version - version='1.0.1', + version='1.1.0', description='''A ResourceView that uses Microsoft's Doc preview''', long_description=long_description, diff --git a/test.ini b/test.ini deleted file mode 100644 index c7c70e7..0000000 --- a/test.ini +++ /dev/null @@ -1,49 +0,0 @@ -[DEFAULT] -debug = false -smtp_server = localhost -error_email_from = paste@localhost - -[server:main] -use = egg:Paste#http -host = 0.0.0.0 -port = 5000 - -[app:main] -use = config:../ckan/test-core.ini - -# Insert any custom config settings to be used when running your extension's -# tests here. - - -# Logging configuration -[loggers] -keys = root, ckan, sqlalchemy - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARN -handlers = console - -[logger_ckan] -qualname = ckan -handlers = -level = INFO - -[logger_sqlalchemy] -handlers = -qualname = sqlalchemy.engine -level = WARN - -[handler_console] -class = StreamHandler -args = (sys.stdout,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s \ No newline at end of file