[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] put() and command line args
From: |
Christian Vest Hansen |
Subject: |
Re: [Fab-user] put() and command line args |
Date: |
Mon, 20 Oct 2008 22:41:30 +0200 |
On Mon, Oct 20, 2008 at 10:26 PM, Jeff Forcier <address@hidden> wrote:
> Then, your command can expect to get the arguments as keyword
> arguments as is normal in Python:
>
> def upload(f1, f2, f3):
> put(f1)
> put(f2)
> ...
Not in vanilla Fabric 0.0.9. See bellow.
>
> And, of course, you can do the usual ** trick to take any arbitrary
> number of files to upload:
>
> def upload(**kwargs):
> for filename in kwargs.values():
> put(filename)
It's kwargs.keys() instead of values(), but otherwise this is the only
way to do it.
However!!! I just fixed it so it works with values() and your
multiple-arguments trick above.
Maybe it's something you had in your own branch?
>
> (Note that I am probably not using the right call signature for
> 'put()' here, as it's one part of Fabric I haven't used much yet :))
put takes two arguments: localpath and remotepath, and an optional fail.
--
Venlig hilsen / Kind regards,
Christian Vest Hansen.