Search This Blog

Monday, April 22, 2013

Challenge 3 script

The full summary of all posts for API Rackspace challenge can be found here:
Rackspace api-challenge summary

Challenge 3 script

Below is the output and the results for the script #3 from the api-challenge.
The script first checks if the provided directory exists.
Next checks if there is a container with the name you provided.
If there is not it creates a new container.
It uploads all files and directories from the directory dir-name to cloud files and saves them in the container container-name.
After it finishes it neither deletes the local directory or the container it created.
$ python
[09:47:54] missing params

    usage: [-h] [-v] dir-name container-name
        -h - usage help
        -v - verbose / debug output
        dir-name - a path to a directory
        container-name - upload the dir-name to this cloud container

$ python tmp/challenge3-test.d/ cfdir
[09:47:01] Uploading directory tmp/challenge3-test.d/ to container cfdir
[09:47:01] container cfdir don't exists, create a new one ...
Total bytes to upload: 181
Progress: 0.00%
Progress: 16.57%
Progress: 73.48%
Progress: 100.00%     


No comments:

Post a Comment