storj-archived / storj-python-sdk

Deprecated. A Python SDK for the Storj API.
https://storj.io
MIT License
23 stars 19 forks source link

implement file upload #98

Closed marcorosa closed 7 years ago

marcorosa commented 7 years ago

I've implemented a first version of file upload. I've tested the upload of several files and it has always worked fine. The code is based on the storj-gui-client I'm working on with @lakewik (https://github.com/lakewik/storj-gui-client) There is still some work to do, some hints:

How to use it:

from upload import Uploader
u = Uploader(email, password)
u.createNewUploadThread(bucket_id, file_path, tmp_path)
steenzout commented 7 years ago

@marcorosa the build failed. look here.

I think it's just a lint problem. comments need to have a white space after the # character.

you can simulate the same problems using tox -e py27 -- --ignore tests/integration.

steenzout commented 7 years ago

@marcorosa PR to develop :)

marcorosa commented 7 years ago

I thought I selected develop branch.. my bad :sweat_smile:

marcorosa commented 7 years ago

@steenzout do I need to fix all the pep8 errors? I think that many of the lines generating errors are going to be edited or changed in future updates

steenzout commented 7 years ago

you only have 1 error now:

=================================== FAILURES ===================================
__________________________ PEP8-check(ignoring W503) ___________________________
[gw0] linux2 -- Python 2.7.9 /home/travis/build/Storj/storj-python-sdk/.tox/py27/bin/python2.7
/home/travis/build/Storj/storj-python-sdk/storj/uploader.py:32:120: E501 line too long (141 > 119 characters)
        FROM: <https://janusznawrat.wordpress.com/2015/04/08/wyliczanie-kryptograficznych-sum-kontrolnych-hmac-plikow-i-lancuchow-znakowych/>
                                                                                                                       ^
1 failed, 95 passed in 3.35 seconds
ERROR: InvocationError: '/home/travis/build/Storj/storj-python-sdk/.tox/py27/bin/py.test -q --basetemp=/home/travis/build/Storj/storj-python-sdk/.tox/py27/tmp --confcutdir=.. -n 1 --junitxml=tests/junit.xml --cov-report xml --cov storj --cov-report=html --cov-report term-missing --pep8 --ignore=tests/integration'
___________________________________ summary ____________________________________
ERROR:   py27: commands failed
coveralls commented 7 years ago

Coverage Status

Coverage decreased (-15.04%) to 54.459% when pulling e2d79ce7ae45da05abd1adc265b3c2198ff94fa0 on marcorosa:develop into 91e68d5e45eaae1bafa8d674b4d6db23482aa7c5 on Storj:develop.

marcorosa commented 7 years ago

Ok tests passed :D