Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13 from phovea/release_0.1.0
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
Samuel Gratzl authored Apr 5, 2017
2 parents 229f52b + 8fb83a9 commit bca3ae1
Show file tree
Hide file tree
Showing 22 changed files with 441 additions and 100 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
# build config
*.npmignore text
*.bowerrc text
Dockerfile text eof=LF

# Heroku
Procfile text
Expand Down Expand Up @@ -123,4 +124,4 @@ AUTHORS text
# Note: .db, .p, and .pkl files are associated
# with the python modules ``pickle``, ``dbm.*``,
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
# (among others).
# (among others).
45 changes: 29 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,50 @@ sudo: required
env:
- TOXENV=py27
- TOXENV=py34

node_js:
- 6

addons:
firefox: 49.0.1
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- nvm install 6
- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi

install:
- (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
- "(!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get
install -y))"
- pip install -r requirements_dev.txt
- pip install -r requirements.txt
- npm install

script: npm run dist

notifications:
slack:
secure: S52ExoUgoNx1nkCaN/S4z20BBIwO0tA0+ugr8Hej19yQdbAZs10eBKPGSuGXjtW7a9V2TB03FH4Arek7b9T3yFsvSfIjNe5ztPQPfMYMeiONDSQcewSHmBcVCfDWkZ7oPC1/sbzPLKPRI1LNfo6j6ql5ZWeKEY87e7nnSMS8Zka+/zSMllCB9Q5i740uG4dB36KfmlEkY095Az9Jf5XgMWOyM9NjzqVOw69mTB0izCo17tWTYWC6mr9MiWbGn1lVV+72ZaE141lkuC2bg+UmGEjOMrMhSrIfW3LpRCOImE2GBufD3t44zBEVmPvdbfA2d9C28cRcVWCUx7F5riy/Iudi0UvzW21I4C3G7rqLz9iWcEPPoqcy2ShJd7PGq79HR6pXT3jY0f7gcvC3PLE/2dB5B5HdcSpK7forBmoLyUE4NizBsRP2qU0l8x/ups/t2Z5UNkiDjZESoISXEq7idUhvKfHrjqJfP1KgcBF7wyr/J9oxOzRakZCWn+tIcJMVXK+lGmLQI4yWtS6aHrHUODJNOUCtysbvtJjL1TIHtfXwZMSGkXBjgjz+xJEr0H+d3DPlN/nA+i6gcOjuU+dA7TYdoVZ1a8FxcfZzroCBVgOOs79mEsWPKnogHmhaj2ahFYE5guXBFy9AUM9XcGE9LIsOnurrh7Huj1qIe/oXgwg=
on_success: change
on_failure: always
deploy:
provider: releases
- provider: releases
api_key:
secure: TK9/P34Bi3WuppiDrBCwVcn41yCBwmILaU8hXTBzUPbT7TbeFIwsC6/4CtH85Z+ZrUve4S5pTmWRNf2dQDxWw3uYu7+bJuemV2J1LHG76mognj+TNEiYxfLQUt3Gql4W7C7FcI4Rlx5/uMN9wY1wro8TWUBMwT6jjSrUWIvK3GXoojd5bHvJx07XpjWl9wCon4D0ruZiFoM2mdeP23lbc2GckETi32oEKswnQXxkMACmxbPzoWbvkxH4aK8Bt2Rj2sl2TbPhVkN6DAkHGkGAvLI+2/aRfG27+oo3OKsaDjbuGABct8TfZccJ970CbQ8kbnCjYxstvqkg1JWjF0W67sX/flBZZOEUA5l0OLWo6HqMGMxm7/lEQhIdPMsRmvXL+HVOxkMrB2dda58QzxVwiZp+rRqUaeabPZp8Kl5xodGrVxsBvxe6zAbJ5jCtCSumG6+kLyKI00/kYlghqQNrgUw0ZsYJlQ34h3lo/24QpaeyDpQoCkGWQgtgqiXGpeKSu7bCnOqIqAy3nbT9Utwj7K8gIasTG5idosEAz/THMampNbGDuyxxc340sYGNMg9Bhm1g2ILWRdtV470p5hwBtIDTKi3/PAizEO26+Wh0zI47Sg3ao57avcbCsTmzbZUeA5J4bojmchhJCHX8su9cSCGh/2fJA/1eBIgEvOQ8LNE=
secure: YHm6ykz8crvmZTh8O2suOFvM/yyhueIE7R/yc4vH5OvlQ8lfy/tJ9QNh8OZ3LkrrWMDmhMXCvReUZaacJKc2abMtO2wX5zQn61KXvZwdrxDKdj/tKHGt7sSsZj2/QgV2eAw6xpoIOEsQqGl+jTGuyyl7EB1WyOP6ZTfGbYDJGkMEyDdrG70DzlIF7sTO/AOwTtj0DiiihVTMfa9apaX1OgjZtu65spb/QnihiGlRyW9rMYKznPLP19eUjOH/Dd5jd5aeMIWaLkF6Xsb/uus4ulOP1uOCfAP1q0ULvsn54hlL5N9zq6nX0VuAf8ieaR1N5M1AI/XO9vt5hmQ9XADfBV4OUaqIh6ZsWAjsBu6TmzL+1XFJ0G2AfF4EFT+OUuYpCmuH3tZyocqWU2C7bLxwDNkoyu6F+ge9YZCz+GThmWYJs9ELbBXwneOQwaDjKoyzQ2TVKGYqUbori8b/n5DPjJDI4qU0oNXuCwb3n77o3l5ntHOq/8+3rJkywC8Fm/g7/peW+pE3Rrb9Xo9SdKmG3vYh/WjDBoEje1hD1/LWPZJs0skOq1S0OvoI4uGKuhX1G/HQlfEGgikeXojF9xP07d3T1ZZDjKEufrHQ4RacCYRIDZrEFXLxKu7VNE87BIuo0xNVyp+1o+JrfKRdmE41mr+aIx0B+67rTyw2RKks0GQ=
file_glob: true
file:
- dist/phovea_security_flask*.egg
- dist/phovea_security_flask.tar.gz
- dist/phovea_security_flask*.egg
- dist/phovea_security_flask.tar.gz
on:
tags: true

notifications:
slack:
secure: E8/1UIdHSczUbN+6i6gd1d5LM4vmLdwLQ30tpyjvnM0wvfDce76oPxLJAy240WJ5ybXRZUtNrttpVpt4tEXCy8aLFCmxD7s77rVloH+q1J8R/ptTFWZGhFGEujk1awEmVbzcWxJkV9/JENQaeGBKxwv8/EQwWwEkAb7p/+AJb9owmH88b3wUZUGHBWtbMiyyaF4Rm1Wg1stJB8Z1Ga7PRF4cqufTgcDdsCPVv9gAY+VxOIGqX/Vfuc9UWpUH8vq8lHUE7Inn5QS78kuFfSgLWga3H6Mu/Gko1XNlWk0QWWQBUvEZ6ZC6Wuo68KzvUjJHDTnx8WyfHue2JNHIslcX+eJq2WHLeEgM24VeNkILCGo/H/60NGHiSjrIv/Y9h6bQ9FDjo6TUyE4nbdPYN1RN9FQ5UbI9Y4Gi753H9mqnHWlEywBOzHxdZCAuz9Wh03CCF/blsvJ+Obbyo6Jrfe+g44jyi9kQdBNQ78qG6v4EXws8FiYao6x3PpgIwFix42Cpr+soAh5FpA3C1zHSAyZZpXF65/lrDl5yPNofK7Wy0B9bw+0I6Z/u7ZKFNVZXvYPGYvtUVcsALGBdmYc61+LCta36Po0KZseWVAlJj6QnOJDYzv0wvV/zsuf9A5KpYFGiqV9Q7zmtiO5FYF5sBy+lE7O9tHVO4O18IRndhRQgxhs=
on_success: change
on_failure: always
repo: phovea/phovea_security_flask
- provider: npm
email: [email protected]
api_key:
secure: xHvo+qsduckAf+nfH/e6pgHNVlv04/Yupr/fV9vdkD7Ho6Uig4wPc1s/779GIJv80ilTcv3puZnW7DMfwoutodmXWMYtAht+8lv+wSDHaG0/K9FmkJJtKhd3milvWEM4jAkmbel4amI4E+kqgJiNshXlrdsrhF9mVpyS04WEbV0dXvmFS8krYIFIhjvB3ot61pxPsGJd/DHRviVvU6+kzMLQOzlywdAZ41DfwufNtZQNqLcUsUMk+ma/1HcAljuAVi3xkdcCBQNJDEpwjCmKk9XbaMD15hy6LY+vEqKTB5HieXrFoML6cyNTMLPELuuyBRSV6JMG5k010/PgI0ODSuTARBPmbiBpa43aikD9wLEZX+O/6n9sWe4aRL5n2BU/5tUPmIZ4DC3DDGe12z1mBH8CuQdy4ZatsnU3Oc4xB8fA5z4yBljbhnD6mSF9hAgvSU/XHjMevqxm8W2fCzqGBQek0m+HuqljfuLCe90tVNAw+KMTJHI04TqxSm/b72IYYi10L+X6siQRIx4R2bAUsCLiega9EZfKyyePD9bvzh/5sZeXOVJRS6Bh/NUG2ZtJut7eH1zrr5ikt9gNgLVSeUGzE9JOrHBsFv5x7PKr6+I0PV3BaDk2lOw5ySCaUFnHbuDv+dr3HOZ2GjmxHLrMVk4IqoYieUsyWtBLKB6gk38=
on:
tags: true
repo: phovea/phovea_security_flask
- provider: pypi
user: caleydo-bot
password:
secure: tPZNRqwrS0LJ/Me3LQhovmRflUqsmtAcPPH8dqH06jz4vA1Ykof8+t3o/Qle43QRYNDN6WyLVTNwcc9045JZi9BXF3lTuXbAdpiedmGjcYUE8NabzPAYNMEMAoGTZ0e0WIoi/GaMHr1tzZPDhDkldasMsBGWYC4uLJUYBOoMtGqwwskk+3tZDLN0n+dlbF91LKbHk5trCxLIslhGhY0i5zjjzIIbV8eOMyu+Jx6T8u7mcCxZrC+1o5ydgy2PgvdZFDd1kfoYDRSnRDLRdrCXGiaKXKcAaer5091wf4iDDWUpRizZD7V9MPc62maeG40EUhju4+Tp4DGBYS26PEB9r45h3cvXremnpCiZlGGEJN7w/miGyGz72DZN2xbo/dOLSQaxdkMYZCPhiEHAA7MZ/eZopMwUfs03Hqm3zcYVwEWvj4O20/UR4uksY0uX6774YXgmrZl+jxB9SBe3AvYdvQqDT8henv/VOSCJ460TfPMHJSCvi4/G/+bVOULU+k9T9E9axi+UweTQVWbOf16iUWixFYMui2cI9jlvORz3IPsDvdicmGqC0H5z32jHo7rrho+nrKJO3s+85Mg3WPWpTYdt0qdaxvh4UOwogUWc52o0h8kARc9Bht66vi5qFm+pkXOc5HXKjZzJKbIhpKdscxVEoBWvM+v9dDqT4CMrI5o=
on:
tags: true
distributions: sdist bdist_wheel
repo: phovea/phovea_security_flask
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ npm run build
***

<a href="https://caleydo.org"><img src="http://caleydo.org/assets/images/logos/caleydo.svg" align="left" width="200px" hspace="10" vspace="6"></a>
This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform for developing web-based visualization applications. For tutorials, API docs, and more information about the build and deployment process, see the [documentation page](http://caleydo.org/documentation/).
This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform for developing web-based visualization applications. For tutorials, API docs, and more information about the build and deployment process, see the [documentation page](http://phovea.caleydo.org).


[phovea-image]: https://img.shields.io/badge/Phovea-Client%20Plugin-F47D20.svg
Expand All @@ -40,5 +40,5 @@ This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform
[npm-url]: https://npmjs.org/package/phovea_security_flask
[travis-image]: https://travis-ci.org/phovea/phovea_security_flask.svg?branch=master
[travis-url]: https://travis-ci.org/phovea/phovea_security_flask
[daviddm-image]: https://david-dm.org/phovea/phovea_security_flask.svg?theme=shields.io
[daviddm-image]: https://david-dm.org/phovea/phovea_security_flask/status.svg
[daviddm-url]: https://david-dm.org/phovea/phovea_security_flask
51 changes: 51 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import shutil
from codecs import open
import json

__author__ = 'Samuel Gratzl'


def _git_head(cwd):
import subprocess
try:
output = subprocess.check_output(['git', 'rev-parse', '--verify', 'HEAD'], cwd=cwd)
return output.strip()
except subprocess.CalledProcessError:
return 'error'


def _resolve_plugin(repo, version):
import os.path
if os.path.isdir('.git') and repo:
if repo.endswith('.git'):
repo = repo[0:-4]
return repo + '/commit/' + _git_head('.')
# not a git repo
return version


def to_version(v):
import datetime
now = datetime.datetime.utcnow()
return v.replace('SNAPSHOT', now.strftime('%Y%m%d-%H%M%S'))


with open('package.json', 'r', encoding='utf-8') as f:
pkg = json.load(f)

name = pkg['name']
version = to_version(pkg['version'])
resolved = _resolve_plugin(pkg.get('repository', {}).get('url'), version)

# copy source code
shutil.rmtree('build/source/' + name, ignore_errors=True)
shutil.copytree(name, 'build/source/' + name, symlinks=False, ignore=shutil.ignore_patterns('*.pyc'))

# create buildInfo.json
build_info = dict(name=name, version=version, resolved=resolved, description=pkg['description'],
homepage=pkg.get('homepage'), repository=pkg.get('repository', {}).get('url'))

# TODO create build Info

with open('build/source/' + name + '/buildInfo.json', 'w', encoding='utf-8') as f:
json.dump(build_info, f, indent=2)
34 changes: 31 additions & 3 deletions buildInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function resolveModules() {
const reg = fs.readFileSync('../phovea_registry.js').toString();
const regex = /import '(.*)\/phovea_registry.js'/g;
const modules = [];
var r;
let r;
while ((r = regex.exec(reg)) !== null) {
modules.push(r[1]);
}
Expand All @@ -59,10 +59,11 @@ function resolveWorkspace() {
console.log('resolve', m);
const pkg = require(`../${m}/package.json`);
const head = gitHead('../' + m);
const repo = pkg.repository.url;
return {
name: pkg.name,
version: pkg.version,
resolved: head ? `${pkg.repository.url}#${head}` : pkg.version,
resolved: head ? `${repo.endsWith('.git') ? repo.slice(0, repo.length-4) : repo}/commit/${head}` : pkg.version,
dependencies: deps(pkg.dependencies)
};
};
Expand Down Expand Up @@ -137,13 +138,40 @@ function tmpdir() {
}
}

function resolveScreenshot() {
const f = resolve(__dirname, 'media/screenshot.png');
if (!fs.existsSync(f)) {
return null;
}
const buffer = new Buffer(fs.readFileSync(f)).toString('base64');
return `data:image/png;base64,${buffer}`;
}

function metaData(pkg) {
pkg = pkg || require(`./package.json`);
return {
name: pkg.name,
version: pkg.version,
repository: pkg.repository.url,
description: pkg.description,
screenshot: resolveScreenshot()
};
}

module.exports.metaData = metaData;
module.exports.metaDataTmpFile = function(pkg) {
const s = metaData(pkg);
const file = `${tmpdir()}/metaData${Math.random().toString(36).slice(-8)}.txt`;
fs.writeFileSync(file, JSON.stringify(s, null, ' '));
return file;
};
module.exports.generate = generate;
module.exports.tmpFile = function() {
const s = generate();
const file = `${tmpdir()}/buildInfo${Math.random().toString(36).slice(-8)}.txt`;
fs.writeFileSync(file, JSON.stringify(s, null, ' '));
return file;
}
};


if (require.main === module) {
Expand Down
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/modules.rst
/phovea_server.rst

Empty file added docs/_static/touch.txt
Empty file.
Empty file added docs/_templates/touch.txt
Empty file.
126 changes: 126 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
import os
import json
from codecs import open

sys.path.insert(0, os.path.abspath('..'))

with open('../package.json', encoding='utf-8') as json_data:
import json

pkg = json.load(json_data)

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
}
source_suffix = ['.rst', '.md']

# The master toctree document.
master_doc = 'index'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['build', 'tests']

# General information about the project.
project = pkg['name']
copyright = pkg['license']
author = pkg['author']['name']

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = pkg['version']
# The full version, including alpha/beta/rc tags.
release = pkg['version']

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = pkg['name'] + 'doc'

# Sort members by type
autodoc_member_order = 'groupwise'


# Ensure that the __init__ method gets documented.
def skip(app, what, name, obj, skip, options):
if name == '__init__':
return False
return skip


def setup(app):
app.connect('autodoc-skip-member', skip)


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
20 changes: 20 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. phovea_security_flask documentation master file, created by
sphinx-quickstart on Tue Feb 7 19:42:32 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to phovea_security_flask's documentation!
=========================================

.. toctree::
:maxdepth: 2
:caption: Contents:

modules

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading

0 comments on commit bca3ae1

Please sign in to comment.