Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Any way to prepend/append a string to each item of a list variable?

Received: by 10.204.127.19 with SMTP id e19mr676656bks.4.1349462364665;
        Fri, 05 Oct 2012 11:39:24 -0700 (PDT)
X-BeenThere: gyp-developer@googlegroups.com
Received: by 10.205.124.16 with SMTP id gm16ls4719576bkc.7.gmail; Fri, 05 Oct
 2012 11:39:24 -0700 (PDT)
Received: by 10.204.4.211 with SMTP id 19mr676335bks.5.1349462363926;
        Fri, 05 Oct 2012 11:39:23 -0700 (PDT)
Received: by 10.204.4.211 with SMTP id 19mr676334bks.5.1349462363899;
        Fri, 05 Oct 2012 11:39:23 -0700 (PDT)
Return-Path: <mar...@google.com>
Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42])
        by gmr-mx.google.com with ESMTPS id k7si1066329bks.2.2012.10.05.11.39.23
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 05 Oct 2012 11:39:23 -0700 (PDT)
Received-SPF: pass (google.com: domain of mar...@google.com designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of mar...@google.com designates 209.85.215.42 as permitted sender) smtp.mail=mar...@google.com; dkim=pass header...@google.com
Received: by mail-la0-f42.google.com with SMTP id e6so1111093lah.29
        for <gyp-developer@googlegroups.com>; Fri, 05 Oct 2012 11:39:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:sender:in-reply-to:references:from:date
         :x-google-sender-auth:message-id:subject:to:cc:content-type
         :x-system-of-record;
        bh=zC6jo+bnVvtIvOX/5hfojIa9YvcXfbGAoZmsjQFCRiA=;
        b=VUxFni1fvBgw5EpBQTs4k/W6+/s/dPNFsWXqU5bA4mrQn7UThUi4G/kpBKcIejAzzi
         QlIbvCepDeecFTLknhAjx4CKPIHs28/fm68tPk11jONOnF7kLQnNG6LDo570Ab781l2U
         si95q2pm/5MEYdgooMyYhPS7v9enfYIZjrrzugW1KYZFFqumVISlymwgibfRaOXUsT7g
         htp0gPi3tFfleIpVAYOyGNbwgb4yuJiBwnjjJuVj8OSOvNQQ6PDu3rz/TLVRilEfiEFq
         WaYr7clBFOwhjC0kh6e/dFE6hAsqvo5pHtrEHjEjT7Z+bfq/2OazO0HOqwa7IdZUpGBM
         Sd3w==
        d=google.com; s=20120113;
        h=mime-version:sender:in-reply-to:references:from:date
         :x-google-sender-auth:message-id:subject:to:cc:content-type
         :x-system-of-record:x-gm-message-state;
        bh=zC6jo+bnVvtIvOX/5hfojIa9YvcXfbGAoZmsjQFCRiA=;
        b=Laz6Kx55rlI7NlHpPUy4kAbJ6JFKsomcPtkJXXPagG7K2Yz0BKrVDSztqPnlkY6s6F
         u5pOTNmIvTqOhnTHmjuYNMVKxtQobAQrGjC4xfIrByA2UAHF+6rA7fKPV/udLTmZCee8
         +Z6WO25xqtkykWgvP9axWCjs6iTBN3fGJPGVMHBWqkYAsPZQ05OwdMTbmjPkLIjwJ28j
         Guy9NvddC+T1lnnoL2WI7cj+TS9OKO83r93p+QV1PjcZtsZh/DqtreRyYZS9VN3Z/8Pu
         ZbDvTP7Q7wX/vN5osVtUe7ypGdRzjXC2pJH5Lt3qcSSTQ+lkaI37SB+mYqJwNOUabYPY
         3+4A==
Received: by 10.112.49.197 with SMTP id w5mr4246482lbn.3.1349462363521; Fri,
 05 Oct 2012 11:39:23 -0700 (PDT)
MIME-Version: 1.0
Sender: mar...@google.com
Received: by 10.114.20.162 with HTTP; Fri, 5 Oct 2012 11:39:03 -0700 (PDT)
In-Reply-To: <5ada8a04-8043-45a0-8545-33f4bd9ec420@googlegroups.com>
References: <5ada8a04-8043-45a0-8545-33f4bd9ec420@googlegroups.com>
From: Marc-Antoine Ruel <mar...@chromium.org>
Date: Fri, 5 Oct 2012 14:39:03 -0400
Message-ID: <CANAQWOUFhy7aXHfg=NiMpaitGW_NmsAfuc48=ETV2iiNEkx...@mail.gmail.com>
Subject: Re: [gyp-developer] Any way to prepend/append a string to each item
 of a list variable?
To: Eric Boren <bore...@google.com>
Cc: gyp-developer <gyp-developer@googlegroups.com>
Content-Type: multipart/alternative; boundary=bcaec554da8ed0c3c404cb543075
X-System-Of-Record: true
X-Gm-Message-State: ALoCoQlDEzqNMlo5Qp25kwyFzfI2MjqctH2+O2CAkWqKl2j4WIqiYn2weiqhuC2rfkZXCJFDSrVjWhGrXUHUNaH1kMx3spqQ87NIP0+8pbvtVd2NF+A+7iVmHO7s79E0mCWsPHGwTS8PAiKiXuetopmn55RNohwJyKlIPqS4yroNh6ThwYclSy1Rq7H+6vqrJ3l85ZQPWr74KQEGUP0EHcBZJoodntsXbg==

--bcaec554da8ed0c3c404cb543075
Content-Type: text/plain; charset=UTF-8

Create a meta-target in somefile.gyp that depends on a, b, c, d with
'type': 'none'.

Then in the other file depend only on the meta-target.

M-A


2012/10/5 Eric Boren <bore...@google.com>

> I have something like this:
> 'variables': {
>   'my_awesome_list': [
>     'a',
>     'b',
>     'c',
>     'd',
>   ],
> },
>
> And I want to use it elsewhere like this:
> ......
> 'dependencies': [
>   'somefile.gyp:<@(my_awesome_list)',
> ],
> ......
>
> Which does not work.  I've tried doing this with a list comprehension:
> ......
> 'dependencies': ['somefile.gyp:%s' % item for item in
> '<@(my_awesome_list)'.split(' ')],
> ......
>
> But that evaluates to:
> 'dependencies': [
>   'somefile.gyp:a b c d',
> ],
>
> If I change it to:
> ......
> 'dependencies': ['%s' % item for item in '<@(my_awesome_list)'.split(' ')],
> ......
>
> It evaluates to:
> 'dependencies': [
>   'a',
>   'b',
>   'c',
>   'd',
> ],
>
> As I would expect.  Why does the above case not work?  Is there another
> way to do this?
>
> Thanks,
>
> Eric
>
> --
>
>
>
>

--bcaec554da8ed0c3c404cb543075
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Create a meta-target in somefile.gyp that depends on a, b, c, d with &#39;t=
ype&#39;: &#39;none&#39;.<div><br><div>Then in the other file depend only o=
n the meta-target.</div></div><div><br></div><div>M-A</div><div class=3D"gm=
ail_extra">

<br><br><div class=3D"gmail_quote">2012/10/5 Eric Boren <span dir=3D"ltr">&=
lt;<a href=3D"mailto:bore...@google.com" target=3D"_blank">bore...@google.c=
om</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 =
0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I have something like this:<div>&#39;variables&#39;: {</div><div>=C2=A0 &#3=
9;my_awesome_list&#39;: [</div><div><div>=C2=A0 =C2=A0 &#39;a&#39;,</div></=
div><div><div>=C2=A0 =C2=A0 &#39;b&#39;,</div></div><div><div>=C2=A0 =C2=A0=
 &#39;c&#39;,</div></div><div>
<div>
=C2=A0 =C2=A0 &#39;d&#39;,</div></div><div>=C2=A0 ],</div><div>},</div><div=
><br></div><div>And I want to use it elsewhere like this:</div><div>......<=
/div><div>&#39;dependencies&#39;: [</div><div>=C2=A0 &#39;somefile.gyp:&lt;=
@(my_awesome_list)&#39;,</div>

<div>],</div><div>......</div><div><br></div><div>Which does not work. =C2=
=A0I&#39;ve tried doing this with a list comprehension:</div><div><div>....=
..</div><div>&#39;dependencies&#39;: [&#39;somefile.gyp:%s&#39; % item for =
item in &#39;&lt;@(my_awesome_list)&#39;.split(&#39; &#39;)],</div>

<div>......</div></div><div><br></div><div>But that evaluates to:</div><div=
>&#39;dependencies&#39;: [</div><div>=C2=A0 &#39;somefile.gyp:a b c d&#39;,=
</div><div>],</div><div><br></div><div>If I change it to:</div><div><div>..=
....</div>

<div>&#39;dependencies&#39;: [&#39;%s&#39; % item for item in &#39;&lt;@(my=
_awesome_list)&#39;.split(&#39; &#39;)],</div><div>......</div></div><div><=
br></div><div>It evaluates to:</div><div><div>&#39;dependencies&#39;: [</di=
v>

<div>=C2=A0 &#39;a&#39;,</div><div>=C2=A0 &#39;b&#39;,</div><div>=C2=A0 &#3=
9;c&#39;,</div><div>=C2=A0 &#39;d&#39;,</div><div>],</div></div><div><br></=
div><div>As I would expect. =C2=A0Why does the above case not work? =C2=A0I=
s there another way to do this?</div>

<div><br></div><div>Thanks,</div><div><br></div><div>Eric</div><span class=
=3D"HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
=C2=A0<br>
=C2=A0<br>
=C2=A0<br>
</font></span></blockquote></div><br></div>

--bcaec554da8ed0c3c404cb543075--