pax_global_header00006660000000000000000000000064134022771010014507gustar00rootroot0000000000000052 comment=7c13700e937159836adf93f0376819ccabe1f7bb B2_Command_Line_Tool-1.3.8/000077500000000000000000000000001340227710100153655ustar00rootroot00000000000000B2_Command_Line_Tool-1.3.8/.gitignore000066400000000000000000000000571340227710100173570ustar00rootroot00000000000000*.pyc .idea b2.egg-info build dist .eggs/ venv B2_Command_Line_Tool-1.3.8/.travis.yml000066400000000000000000000321411340227710100174770ustar00rootroot00000000000000notifications: slack: secure: naix0bLa/50X1HIXwLtkUC/YH9Iurs18eVy/mhfrfD2YFd7QjUGRz24SQU2r0ev0Qh3CUaH9MJoAUbu4oaXGB1VXzZkV7OIGimZe4gcWJuzItnVhyrQJKpcpC7yafdl7uDA0wjWs2BYRHCJ3c35Gv4SmihuGVXUS3WFsL0i3VyXno8xPOfmyuUT7GZWW80uMnV6eOyhbPCBb17CchI8x7owdXVf3drxCrrjoP3oNbbpByTsDC+hnCmVQbhkZAqS63gZRj5LT6gNh4ZA/qenaGkhzfHFRSUW1+H16ZzYcSSl0PfAQBQYrc7agUjI987PBHdOv6BJS+pKmZ0MvaDwbnzhHZZdb8LXqM5K0zAhPiZMPL2MTq7+eNOBdRuTlbWs3OZfbY1cnewSpMmUGfwrIjVnLtvfhfJXVaFbpIfvNc6eafgmHas23A05f4Gk/IcRLvqICw+GQg76ADUpWubQal7gECTGbeivOdRLnQcQYWCg/a5VR5B+4ELENmWLRD7IQgo6rJKpPiRdGRc0C0E9Mqt3w7w+9NiDnjTbSu8Q6ARBLXjAu+jSbY1VK0iPq6k1Wj8U5EgQF/xVLCEtKDRW1bdllwWNgi2yPo1CrkgKmJj6XPU3Zc744NR85uC+PxAjkIIbm90joevPmUQGwkpAgVX2pxCjVAX6ynQ79TFfdd/Y= #dist: trusty # on 2016-12-13 pypy builds were broken on trusty, so we'll stick to stable for now language: python python: - 2.6 - 2.7 - 3.4 - 3.5 - 3.6 - nightly # stock versions of pypy provided by Travis CI don't work with cryptography 1.0 #- pypy #- pypy3 branches: # https://github.com/travis-ci/travis-ci/issues/1147#issuecomment-160820262 # this reduces workload on Travis if there are many pushes in a short time. # It does not have a drawback if: # - pull requests are used for review # - branches that we care about (not work-in-progress) are listed below only: - master matrix: allow_failures: - python: pypy3 # https://github.com/pyca/cryptography/issues/2880 - python: nightly # on 2018-02-14 it was found failing installation with ValueError: bad marshal data (unknown type code) include: # Source Code Analysis is slow. We just run it once on # Python 2 and once on Python 3. - python: 2.7 env: MODE=SCA - python: 3.5 env: MODE=SCA # Travis CI doesn't support OSX python builds officially, # but that won't stop us... # ... or maybe it will. It's now getting this error: # Could not fetch URL https://pypi.python.org/simple/arrow/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) # which stackoverflow says means the python interpreter needs to be upgraded: # https://stackoverflow.com/questions/16370583/pip-issue-installing-almost-any-library # - python: 2.7 # os: osx # language: generic # env: OS_X_PYTHON_VERSION=python # See github issue #311: # - python: 3.5 # os: osx # language: generic # env: OS_X_PYTHON_VERSION=python3 # jython # It looks like Jython has a similar TLS problem to the Mac: # An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. # - python: 2.7 # env: JYTHON=true # pypy - python: pypy env: PYPY_VERSION=pypy-4.0.1 - python: pypy env: PYPY_VERSION=pypy-5.1 - python: pypy3 env: PYPY_VERSION=pypy3-2.4.0 # test_raw_api takes too long to be run in every cell of the build matrix - python: 2.7 env: MODE=TEST_RAW_API - python: 3.6 env: MODE=TEST_RAW_API # coverage - python: 3.5 env: MODE=coverage cache: - pip - directories: - $HOME/.eggs # custom pypy versions - $HOME/.pyenv # jython - $HOME/.virtualenvs/jython - $HOME/jython - $HOME/jython-pip # OS X - $HOME/.virtualenvs/osx-python - $HOME/.virtualenvs/osx-python3 #- /usr/local/Cellar/python # see comment in the install script #- /usr/local/Cellar/python3 before_install: - uname -a - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then lsb_release -a; fi - | # install python on OS X if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [ -n 'ALWAYS TRUE!' -o ! -d "/usr/local/Cellar/$OS_X_PYTHON_VERSION" ]; then # unfortunately caching /usr/local/Cellar/$OS_X_PYTHON_VERSION is not enough. # brew does some kind of side effect which registers the binary in the system # or something. The resulting error error is: # # dyld: Library not loaded: @executable_path/../.Python # # Due to lack of information on the web as well as the lack of appropriate # environment it is very hard to debug out how to properly cache the python # installation on OS X. # # Therefore caching is temporarily disabled until someone figures it out. # Typically brew update and installation of python takes 3 to 4 minutes. travis_retry brew update travis_retry brew install "$OS_X_PYTHON_VERSION" else echo 'skip install' fi if [ ! -e "$HOME/.virtualenvs/osx-$OS_X_PYTHON_VERSION/bin/activate" ]; then virtualenv -p "$OS_X_PYTHON_VERSION" "$HOME/.virtualenvs/osx-$OS_X_PYTHON_VERSION" else echo 'skip virtualenv' fi source "$HOME/.virtualenvs/osx-$OS_X_PYTHON_VERSION/bin/activate" else echo skip fi - | # get jython if [ -n "$JYTHON" ]; then # When the system python changes version, the symlink to it inside jython # breaks, and jython stops working. If that happens, remove the installed # version and start over. if [ -d "$HOME/jython" ]; then if "$HOME/jython/bin/jython" --version; then echo jython version works else echo jython is broken. removing it. rm -rf "$HOME/jython" fi fi # Install jython if it's not there. if [ ! -d "$HOME/jython" ]; then travis_retry wget http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7.1b3/jython-installer-2.7.1b3.jar -O jython-installer-2.7.1b3.jar java -jar jython-installer-2.7.1b3.jar --silent --directory "$HOME/jython" else echo skip install jython fi # install a custom version of pip, as standard pip doesn't work on jython (https://github.com/jythontools/pip/commits/develop) if [ ! -d "$HOME/jython-pip" ]; then mkdir ~/jython-pip else echo skip mkdir jython-pip fi if [ ! -f ~/jython-pip/pip-7.1.2-py2.py3-none-any.whl ]; then travis_retry wget https://pypi.python.org/packages/py2.py3/p/pip/pip-7.1.2-py2.py3-none-any.whl -O ~/jython-pip/pip-7.1.2-py2.py3-none-any.whl else echo skip download pip fi # The virtualenv is another place where the cache can hold broken symlinks. # If the virtualenv doesn't work, remove it. export JAVA_OPTS="-Xms128m -Xmx1024m" if [ -f "$HOME/.virtualenvs/jython/bin/activate" ]; then source "$HOME/.virtualenvs/jython/bin/activate" if python --version; then echo jython virtualenv works else echo jython virtualenv broken. removing it. rm -rf "$HOME/.virtualenvs/jython" fi deactivate fi # create jython virtualenv if [ ! -f "$HOME/.virtualenvs/jython/bin/activate" ]; then virtualenv --system-site-packages --extra-search-dir="$HOME/jython-pip" -p "$HOME/jython/bin/jython" "$HOME/.virtualenvs/jython" else echo skip virtualenv fi # Activate the virtualenv source "$HOME/.virtualenvs/jython/bin/activate" else echo skip setting up jython fi - | # upgrade pypy (to a version that works with Cryptography 1.0) if [ -z "$PYPY_VERSION" ]; then echo 'this is a build of native Travis pypy/pypy3, not the upgraded one' elif [[ "$TRAVIS_PYTHON_VERSION" == "pypy" ]] || [[ "$TRAVIS_PYTHON_VERSION" == "pypy3" ]]; then export PYENV_ROOT="$HOME/.pyenv" if [ -f "$PYENV_ROOT/bin/pyenv" ]; then pushd "$PYENV_ROOT" && git pull && popd else rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT" fi echo "PYPY_VERSION=$PYPY_VERSION" travis_retry "$PYENV_ROOT/bin/pyenv" install --skip-existing "$PYPY_VERSION" if [ ! -e "$HOME/.virtualenvs/$PYPY_VERSION/bin/activate" ]; then virtualenv -p "$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/.virtualenvs/$PYPY_VERSION" fi source "$HOME/.virtualenvs/$PYPY_VERSION/bin/activate" else echo skip upgrade pypy fi - virtualenv --version - python --version - | # upgrade setuptools if it's too old to support PEP 508 # PEP 508 support is needed for python version dependent dependencies in requirements.txt/setup.py (e.g. futures) pip install "setuptools>=20.2" install: - pip install -r requirements.txt - pip install -r requirements-setup.txt - pip install -r requirements-test.txt - | # coverage has additional requirements if [ "$MODE" == 'coverage' ]; then travis_retry pip install coverage if [ -n "$CODACY_PROJECT_TOKEN" ]; then travis_retry pip install codacy-coverage; fi if [ -n "$COVERALLS_REPO_TOKEN" ]; then travis_retry pip install coveralls; fi if [ -n "$CODECOV_TOKEN" ]; then travis_retry wget https://codecov.io/bash -O codecov.sh && chmod +x codecov.sh; fi fi before_script: - pip freeze # Before runing the test case, we need to make jython run some code as in first run it can put something on stdout - if [ -n "$JYTHON" ]; then python -c "print ''"; else echo skip; fi script: - | # nosetests if [ -z "$MODE" ]; then python setup.py nosetests elif [ "$MODE" == 'coverage' ]; then python setup.py nosetests --with-coverage --cover-xml --cover-package "$(python setup.py --name)" --cover-branches else echo skip fi - | # yapf if [ "$MODE" == 'SCA' ]; then if [ -n "$TRAVIS_COMMIT_RANGE" ]; then echo "using commit range: $TRAVIS_COMMIT_RANGE" git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep '\.py$' | xargs yapf --diff setup.py || exit else yapf --diff --recursive . || exit fi else echo skip fi - if [ "$MODE" == 'SCA' ]; then pyflakes . || exit; else echo skip; fi # isort doesn't get along with yapf. Hopefully we'll figure it out and re-enable in the future. # - if [ "$MODE" == 'SCA' ]; then isort --order-by-type --recursive --line-width 100 --diff --verbose --check-only || exit; else echo skip; fi # home-made bad code detectors - if [ "$MODE" == 'SCA' ]; then egrep -r '^ *class [^\(]+(\(\))?:' . && exit 1 || true; else echo skip; fi # old-style class detector - if [ "$MODE" == 'SCA' ]; then grep -r 'isinstance\(' . && exit 1 || true; else echo skip; fi # very non-pythonic - if [ "$MODE" == 'SCA' ]; then egrep -r '\b(all|any)\(\[' . && exit 1 || true; else echo skip; fi # a list is unnecesarily allocated where a generator expression could have been used - if [ "$MODE" == 'SCA' ]; then grep -r '\_\_metaclass\_\_' . && exit 1 || true; else echo skip; fi # bad metaclass declaration: use six - if [ "$MODE" == 'SCA' ]; then grep -P -r '^ *logger = (?!logging\.getLogger\(__name__\)$)' . | grep -v '.eggs/nose-' && exit 1 || true; else echo skip; fi # bad logger definition: use `logger = logging.getLogger(__name__)`. See the magic logging metaclass. - | if [ "$MODE" == 'SCA' ]; then missing="$( ( grep -l "Copyright $(date +%Y).*\\. All Rights Reserved." $(git ls-files | grep .py) git ls-files | grep .py ) | sort | uniq -c | sort -n | awk '$1 == 1 && $2 !~ ".*/__init__.py"' )" if [ -n "$missing" ]; then echo 'license is missing from:' >&2 echo "$missing" >&2 return 1 fi else echo skip fi # package installation - | if [ "$MODE" == 'SCA' ]; then echo skip else if [ -n "$OS_X_PYTHON_VERSION" ]; then # install action fails on osx for unknown reason python setup.py develop else python setup.py install fi fi # custom things specific to b2 CLI - if [ -n "$TEST_ACCOUNT_ID" -a "$MODE" == "TEST_RAW_API" ]; then python -m b2.__main__ test_raw_api; else echo skip; fi after_success: - if [ "$MODE" == 'coverage' -a -n "$CODACY_PROJECT_TOKEN" ]; then travis_retry python-codacy-coverage -r coverage.xml; else echo skip; fi - if [ "$MODE" == 'coverage' -a -n "$COVERALLS_REPO_TOKEN" ]; then travis_retry coveralls; else echo skip; fi - if [ "$MODE" == 'coverage' -a -n "$CODECOV_TOKEN" ]; then travis_retry ./codecov.sh -X gcov -X coveragepy; else echo skip; fi B2_Command_Line_Tool-1.3.8/LICENSE000066400000000000000000000025061340227710100163750ustar00rootroot00000000000000Backblaze wants developers and organization to copy and re-use our code examples, so we make the samples available by several different licenses. One option is the MIT license (below). Other options are available here: https://www.backblaze.com/using_b2_code.html The MIT License (MIT) Copyright (c) 2015 Backblaze Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. B2_Command_Line_Tool-1.3.8/MANIFEST.in000066400000000000000000000001701340227710100171210ustar00rootroot00000000000000include README.md include requirements.txt include requirements-test.txt include requirements-setup.txt include LICENSE B2_Command_Line_Tool-1.3.8/Makefile000066400000000000000000000014041340227710100170240ustar00rootroot00000000000000help: ## Show this help. @fgrep -h "##" Makefile | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' @echo "" @echo "To see doc options, cd to doc and type \"make\"" .PHONY: setup setup: ## Set up (to run tests) using your current python environment setup: ## and enable pre-commit hook for this repo only. python -m pip install -r requirements-test.txt ln -s $(PWD)/pre-commit.sh .git/hooks/pre-commit || true .PHONY: test test: ## Run unit tests ./run-unit-tests.sh .PHONY: format: ## Format code using yapf yapf --verbose --in-place --parallel --recursive --exclude '*eggs/*' . .PHONY: clean clean: ## Remove stuff you can regenerate rm -rf b2.egg-info build TAGS find . -name __pycache__ | xargs rm -rf find . -name \*~ -o -name \*.pyc | xargs rm -f B2_Command_Line_Tool-1.3.8/README.md000066400000000000000000000222101340227710100166410ustar00rootroot00000000000000# B2 Command Line Tool [![Travis CI](https://img.shields.io/travis/Backblaze/B2_Command_Line_Tool/master.svg?label=Travis%20CI)](https://travis-ci.org/Backblaze/B2_Command_Line_Tool) [![License](https://img.shields.io/pypi/l/b2.svg?label=License)](https://pypi.python.org/pypi/b2) [![python versions](https://img.shields.io/pypi/pyversions/b2.svg?label=python%20versions)](https://pypi.python.org/pypi/b2) [![PyPI version](https://img.shields.io/pypi/v/b2.svg?label=PyPI%20version)](https://pypi.python.org/pypi/b2) The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage. This program provides command-line access to the B2 service. Version 1.3.8 # Installation This tool can be installed with: pip install b2 If you see a message saying that the `six` library cannot be installed, which happens if you're installing with the system python on OS X El Capitan, try this: pip install --ignore-installed b2 # Usage b2 authorize-account [] [] b2 cancel-all-unfinished-large-files b2 cancel-large-file b2 clear-account b2 create-bucket [--bucketInfo ] [--corsRules ] [--lifecycleRules ] [allPublic | allPrivate] b2 create-key [--duration ] [--bucket ] [--namePrefix ] b2 delete-bucket b2 delete-file-version [] b2 delete-key b2 download-file-by-id [--noProgress] b2 download-file-by-name [--noProgress] b2 get-account-info b2 get-bucket [--showSize] b2 get-download-auth [--prefix ] [--duration ] b2 get-download-url-with-auth [--duration ] b2 get-file-info b2 help [commandName] b2 hide-file b2 list-buckets b2 list-file-names [] [] b2 list-file-versions [] [] [] b2 list-keys b2 list-parts b2 list-unfinished-large-files b2 ls [--long] [--versions] [--recursive] [] b2 make-url b2 sync [--delete] [--keepDays N] [--skipNewer] [--replaceNewer] \ [--compareVersions