Skip to content

Commit

Permalink
Merge branch '1.0.x' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Dec 13, 2016
2 parents 832bfcc + 506bf0e commit 50bc3fe
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 9 deletions.
99 changes: 99 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Contents
* [Notes](#notes)
* [Contributing](#contributing)
* [Resolving Merge Conflicts](#resolving-merge-conflicts)
* [Best Practices for Contributing](#best-practices-for-contributing)
* [Attribution](#attribution)

# Notes
[Notes]: #notes

Any contributions received are assumed to be covered by the BSD 3-Clause license. We might ask you to sign a Contributor License Agreement before accepting a larger contribution. To learn more about ReproZip, see:
* [ReproZip Examples](https://vida-nyu.github.io/reprozip-examples/)
* [ReproZip Documentation](https://reprozip.readthedocs.io/)
* [ReproZip Demo Video](https://www.youtube.com/watch?v=-zLPuwCHXo0)

# Contributing
[Contributing]: #contributing

Please follow the [Citizen Code of Conduct](https://github.com/stumpsyn/policies/blob/master/citizen_code_of_conduct.md) in all your interactions with the project. If you would like to contribute to this project by modifying/adding to the code, please read the [Best Practices for Contributing] below and feel free to follow the standard GitHub workflow:

1. Fork the project.
2. Clone your fork to your computer.
* From the command line: `git clone https://github.com/<USERNAME>/reprozip.git`
3. Change into your new project folder.
* From the command line: `cd reprozip`
4. [optional] Add the upstream repository to your list of remotes.
* From the command line: `git remote add upstream https://github.com/ViDA-NYU/reprozip.git`
5. Create a branch for your new feature.
* From the command line: `git checkout -b my-feature-branch-name`
6. Make your changes.
* Avoid making changes to more files than necessary for your feature (i.e. refrain from combining your "real" pull request with incidental bug fixes). This will simplify the merging process and make your changes clearer.
7. Commit your changes. From the command line:
* `git add <FILE-NAMES>`
* `git commit -m "A descriptive commit message"`
8. While you were working some other changes might have gone in and break your stuff or vice versa. This can be a *merge conflict* but also conflicting behavior or code. Before you test, merge with master.
* `git fetch upstream`
* `git merge upstream/master`
9. Test. Run the program and do something related to your feature/fix.
10. Push the branch, uploading it to GitHub.
* `git push origin my-feature-branch-name`
11. Make a "Pull Request" from your branch here on GitHub.

# Resolving Merge Conflicts
[Resolving Merge Conflicts]: #resolving-merge-conflicts

Depending on the order that Pull Requests get processed, your PR may result in a conflict and become un-mergable. To correct this, do the following from the command line:

Switch to your branch: `git checkout my-feature-branch-name`
Pull in the latest upstream changes: `git pull upstream master`
Find out what files have a conflict: `git status`

Edit the conflicting file(s) and look for a block that looks like this:
```
<<<<<<< HEAD
my awesome change
=======
some other person's less awesome change
>>>>>>> some-branch
```

Replace all five (or more) lines with the correct version (yours, theirs, or
a combination of the two). ONLY the correct content should remain (none of
that `<<<<< HEAD` stuff.)

Then re-commit and re-push the file.

```
git add the-changed-file.cs
git commit -m "Resolved conflict between this and PR #123"
git push origin my-feature-branch-name
```

The pull request should automatically update to reflect your changes.

## Best Practices for Contributing
[Best Practices for Contributing]: #best-practices-for-contributing
* Before you start coding, open an issue so that the community can discuss your change to ensure it is in line with the goals of the project and not being worked on by someone else. This allows for discussion and fine tuning of your feature and results in a more succent and focused additions.
* If you are fixing a small glitch or bug, you may make a PR without opening an issue.
* If you are adding a large feature, create an issue so that we may give you feedback and agree on what makes the most sense for the project before making your change and submitting a PR (this will make sure you don't have to do major changes down the line).

* Pull Requests represent final code. Please ensure they are:
* Well tested by the author. It is the author's job to ensure their code works as expected.
* Free of unnecessary log calls. Logging is great for debugging, but when a PR is made, log calls should only be present when there is an actual error or to warn of an unimplemented feature.

* If your code is untested, log heavy, or incomplete, prefix your PR with "[WIP]", so others know it is still being tested and shouldn't be considered for merging yet. This way we can still give you feedback or help finalize the feature even if it's not ready for prime time.

That's it! Following these guidelines will ensure that your additions are approved quickly and integrated into the project. Thanks for your contribution!

# Attribution
[Attribution]: #attribution

This CONTRIBUTING.md was adapted from [ProjectPorcupine's](https://github.com/TeamPorcupine/ProjectPorcupine)'s [CONTRIBUTING.md](https://github.com/TeamPorcupine/ProjectPorcupine/blob/master/CONTRIBUTING.md)

# Contact info
[Contact info]: #contact-info

You are welcome to [subscribe to](https://vgc.poly.edu/mailman/listinfo/reprozip-users) or contact our user mailing list [reprozip-users](mailto:reprozip-users@vgc.poly.edu) for questions, suggestions and discussions about using ReproZip.

You can contact the maintainers on the [reprozip-dev](mailto:reprozip-dev@vgc.poly.edu) mailing list.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
[![Code Health](https://landscape.io/github/ViDA-NYU/reprozip/master/landscape.png)](https://landscape.io/github/ViDA-NYU/reprozip/master)
[![Documentation Status](https://readthedocs.org/projects/reprozip/badge/?version=latest)]
(https://reprozip.readthedocs.io/en/latest/)
[![Matrix](https://remram44.github.io/matrix-appservice-gitter-twisted/img/matrix-badge.svg)](https://vector.im/beta/#/room/#reprozip:matrix.org)
[![Matrix](https://img.shields.io/badge/chat-matrix.org-brightgreen.svg)](https://riot.im/app/#/room/#reprozip:matrix.org)
[![status](http://joss.theoj.org/papers/b578b171263c73f64dfb9d040ca80fe0/status.svg)]
(http://joss.theoj.org/papers/b578b171263c73f64dfb9d040ca80fe0)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.60654.svg)](https://doi.org/10.5281/zenodo.60654)

ReproZip
Expand Down
Binary file added docs/figures/reprounzip-qt-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/reprounzip-qt-defaultApp-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/reprounzip-qt-defaultApp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/reprounzip-qt-manageFiles.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/reprounzip-qt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions docs/gui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.. _unpacking-gui:

ReproUnzip GUI
**************

**reprounzip-qt** is a graphical interface (GUI) for reprounzip, allowing you to unpack and reproduce experiments from ``.rpz`` files without having to use the command-line. You can also set it as the default handler for the ``.rpz`` file extension so you can open them via double-click.

Installation
============

*reprounzip-qt* comes with the installer on `Windows <http://reprozip-files.s3-website-us-east-1.amazonaws.com/windows-installer>`_ and `Mac <http://reprozip-files.s3-website-us-east-1.amazonaws.com/mac-installer>`_. If you used one of these, you will be able to double click on any ``.rpz`` file to boot up the GUI.

If you are using Anaconda, you can install *reprounzip-qt* from anaconda.org::

$ conda install --channel vida-nyu reprounzip-qt

Otherwise, you will need to `install PyQt4 <https://www.riverbankcomputing.com/software/pyqt/download>`__ before you can install *reprounzip-qt* from pip (on Debian or Ubuntu, you can use ``apt-get install python-qt4``).

On Linux, setting it as the default to open ``.rpz`` files is a bit more involved. Once the application is setup, run `this script <https://gist.github.com/remram44/0092c0b27269cfd0e5530428612d9309>`__ by opening up a terminal window and entering ``bash register-linux.sh``. From there, you can back-click on a ``.rpz`` file, and set the default application to ReproUnzip. The following is an example of this process on Ubuntu 16.04:

.. image:: figures/reprounzip-qt-defaultApp.png

If ReproUnzip doesn't appear right away, simply click "Other Application" and find it in the menu, alphabetically.

.. image:: figures/reprounzip-qt-defaultApp-1.png

Usage
============

The first tab in the window that appears is for you to set up the experiment. This will allow you to choose which `unpacker <unpacking.html#unpackers>`_ you'd like to use to reproduce the experiment, and in which directory you'd like to unpack it.

.. image:: figures/reprounzip-qt.png

After successfully unpacking, you'll be prompted to run the experiment in the second tab. You can choose which run you want to execute, though the default is to have all runs selected. ReproUnzip will detect the order of the runs and reproduce the experiment accordingly.

.. image:: figures/reprounzip-qt-1.png

Clicking "Manage Files" will bring up options to download the input and output data of the original experiment, and upload your own data to use it in the same experiment. You'll notice input files are marked ``[I]`` and output files are marked ``[O]``. ``[IO]`` are both input and output files.

.. image:: figures/reprounzip-qt-manageFiles.png
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Contents
unpacking
graph
vistrails
gui
faq
troubleshooting
unpacked-format
Expand Down
6 changes: 3 additions & 3 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ For Mac OS X, only the *reprounzip* component is available.
Binaries
--------

An installer containing Python 2.7, *reprounzip*, and all the plugins can be `downloaded from GitHub <https://github.com/ViDA-NYU/reprozip/releases/latest>`__.
An installer containing Python 2.7, *reprounzip*, and all the plugins can be `downloaded from GitHub <http://reprozip-files.s3-website-us-east-1.amazonaws.com/mac-installer>`__.

Required Software Packages
--------------------------
Expand Down Expand Up @@ -146,7 +146,7 @@ For Windows, only the *reprounzip* component is available.
Binaries
--------

A 32-bit installer containing Python 2.7, *reprounzip*, and all the plugins can be `downloaded from GitHub <https://github.com/ViDA-NYU/reprozip/releases/latest>`__.
A 32-bit installer containing Python 2.7, *reprounzip*, and all the plugins can be `downloaded from GitHub <http://reprozip-files.s3-website-us-east-1.amazonaws.com/windows-installer>`__.

Required Software Packages
--------------------------
Expand Down Expand Up @@ -192,7 +192,7 @@ Or you can install *reprounzip* and choose components manually::
Anaconda
========

*reprozip* and *reprounzip* can also be installed on the `Anaconda <https://store.continuum.io/cshop/anaconda>`__ Python distribution, from Binstar::
*reprozip* and *reprounzip* can also be installed on the `Anaconda <https://store.continuum.io/cshop/anaconda>`__ Python distribution, from anaconda.org::

$ conda install --channel vida-nyu reprozip reprounzip reprounzip-docker reprounzip-vagrant reprounzip-vistrails

Expand Down
2 changes: 1 addition & 1 deletion reprounzip-qt/reprounzip_qt/reprounzip_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
safe_shell_chars = set("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"-+=/:.,_%")
"-+=/:.,%_")


def shell_escape(s):
Expand Down
2 changes: 1 addition & 1 deletion reprounzip/reprounzip/unpackers/common/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def shell_escape(s):
"""
if isinstance(s, bytes):
s = s.decode('utf-8')
if any(c not in safe_shell_chars for c in s):
if not s or any(c not in safe_shell_chars for c in s):
return '"%s"' % (s.replace('\\', '\\\\')
.replace('"', '\\"')
.replace('$', '\\$'))
Expand Down
11 changes: 8 additions & 3 deletions reprozip/reprozip/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import os
from rpaths import Path
import sqlite3
import string
import sys

from reprozip import __version__ as reprozip_version
Expand All @@ -36,12 +35,18 @@
from reprozip.utils import PY3, unicode_, stderr


safe_shell_chars = set("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"-+=/:.,%_")


def shell_escape(s):
"""Given bl"a, returns "bl\\"a".
r"""Given bl"a, returns "bl\\"a".
"""
if isinstance(s, bytes):
s = s.decode('utf-8')
if any(c in s for c in string.whitespace + '*$\\"\''):
if not s or any(c not in safe_shell_chars for c in s):
return '"%s"' % (s.replace('\\', '\\\\')
.replace('"', '\\"')
.replace('$', '\\$'))
Expand Down

0 comments on commit 50bc3fe

Please sign in to comment.