Op woensdag 6 maart 2013 15:06:08 UTC+1 schreef Jeroen Demeyer het volgende: > > On 2013-03-06 15:01, Timo Kluck wrote: > > so that we could > > start using Python scripts in many places were we use shell scripts now. > > Think the packaging system > We can't do that, since you would have a circular dependency of the > packaging system on plumbum, plumbum on Python, Python on the packaging > system (to get installed). > True. You will always have to do some bootstrapping in shell scripts. But there's plenty of shell scripts that are run after we have a working system.
> Besides, what's wrong with shell scripts? None of your examples > convinced me that plumbum is better than a shell script. > I was trying to convince you that it is 'just as good' as a shell script. But this is now happening in python, which means that you can suddenly mix all that piping with with dictionaries, arrays, or any other things in which python is superior to bash. Think readability and quoting, and exceptions instead of checking exit codes. The library API abstracts away from having to do escaping of arguments or preventing shell injections. That'll help against bugs of the type "foo does not work when I have a space in my path". Or another example: #!/bin/bash git checkout -b my_temporary_branch <do my temporary changes> git commit -am "temporary" git checkout master Suppose that your first checkout fails (the branch exists, or you are in the middle of a merge, or whatever). Now all your tempary changes are in you master branch. I should have checked exit codes, but who does? With plumbum, the failing checkout will give you an exception right away. This kind of mistake may also cause you to do 'rm -rf *' in the wrong directory if you don't check the exit code of your 'cd' call... Sorry that I wasn't making my argument clear enough the first time. I hope you're at least convinced this is useful. Whether it is useful enough to include it in sage, is up for discussion, of course. Timo -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
