uskudnik / amazon-glacier-cmd-interface

Command line interface for Amazon Glacier
MIT License
374 stars 100 forks source link

Basic python project, environment input variables support #4

Closed offlinehacker closed 12 years ago

offlinehacker commented 12 years ago

I have created basic python setup with all relevant information, so you can now simply run python setup.py install or python setup.py develop and it will automatically download all required dependencies and even create cli app called amazon glacier.

_Code is now located inside glacier_cmd folder._

Usage of virtualenv is recomended:

virtualenv --no-site-packages --python=python2.7 amazon-glacier-cmd-interface python setup.py develop glacier-cmd args

offlinehacker commented 12 years ago

After request is accepted, readme has to be updated, so everybody would know the name of the tool.

uskudnik commented 12 years ago

Awesome! :)

Although not added to git yet, I made a buildout+mr.developer config... interesting or do we just use virtualenv?

offlinehacker commented 12 years ago

Well we use both or however user decides. Just drop in buildout config and that's it :)

I think integration with boto should be next goal. Boto has its own configuration system, because this one has to be changed and integrating a new one here is pointless.

What if you make a new branch and I make push request there, and after that you drop in your buildout.We then wait for boto glacier implementation?

uskudnik commented 12 years ago

buildout.cfg+bootstrap added, but will have to check later if all is well and works.

Yup, integration with boto's configuration is logical next step, as is the process of migrating to boto itself when glacier lands in developer branch of boto with at least semi-stable API. As it stands it seems that current implementation of glacier with glacier.py is quite stable, even for large files and I wouldn't like to make things unstable just so that we are on cutting edge of boto's develop branch.

What did you have in mind with making a new branch and push request there? New branch of boto and push request for glacier.py? If thats the case - while glacier.py does work, its API is not exactly pretty and guys at boto are making it a bit nicer :)

On the semantic side - if we are renaming I am a bit more on the side of glacier-cli or something similar instead of cmd... Your feelings about this?

offlinehacker commented 12 years ago

No, what I ment is that you open a new branch in this project and we merge in this pull request and your buildout and continue development work there.

This changes follows the standard structure how python projects are structured and you can simply install it by using python setup.py install and have command line tool glacier-cmd instantly in your path. The only thing that is missing is incossistent configuration(because if you install system wide -- sudo python setup.py install -- configurations get copied system wide), but i added support for setting AWS and glacier settings as environment variables. Your buildout script also has to be updated to follow standard python project structure, but only slightly. To look an example how python standard project structure looks like, for example look here. Also one more thing, the right way is not to include bootstrap.py in project and give user posibility to use both bootstrap and virtualenv, if that is possible and in that case, it clearly is.

I'm not trying to change the way you work, and it is totally fine if you use other project structure, but i've been working with python people for so long that they got me mad about python rules(written or unwritten). Also about indents. When i open python files with vim it automatically sets indentation to 4 spaces, and i have to force it to use tabs, again, python people and their unwritten rules :P.

uskudnik commented 12 years ago

My bad for bootstrap, this is my first project using buildout and I followed http://www.buildout.org/docs/dirstruct.html directions regarding which files to include. That sounds like a sensible reason for not including bootstrap and give an option of vritualenv and buildout.

Branch botoonly created, your request merged into it already. Also renamed glaciercmd.py to glacier.py and glacier.py to glaciercorecalls.py (since this one will get deprecated and removed as soon as boto only is done). Hopefully (but regarding datetime.datetime.not() not very likely) I haven't forgotten to rename/replace something.

Also switched to 4 spaces to not give your vim too much headache ;)

offlinehacker commented 12 years ago

+1 boto we wait for U.