> On Oct. 20, 2015, 5:06 a.m., Marco Massenzio wrote: > > support/apply-reviews.py, line 160 > > <https://reviews.apache.org/r/39410/diff/3/?file=1100642#file1100642line160> > > > > you don't really need to escape the quotes, just take advantage of > > Python being able to use single and double quotes interchangeably (or even > > use """ if you really want to be hip :) > > Artem Harutyunyan wrote: > I actually do need to escape the quotes becasue {message} is multiline > and I am executing the `cmd` in a shell. > > Marco Massenzio wrote: > I don't understand your comment, I'm afraid. What I did mean was that you > can write: > ``` > cmd = "git commit --author '{author}' -am '{message}'".format(author = > review['author'], ...) > ``` > and this will have the exact same meaning as your code (whether that's > correctly escaped and executed in the shell, I really can't say). > > Artem Harutyunyan wrote: > I see what you're saying. I am using single quotes throughout the code, > that's why I preferred quoting to switching to double quotes for these > particular instances.
ah - that sounds reasonable (although, you'll be relieved to know that PEP8 is silent on that point :) The general approach is to use both, being consistent across "usage classes." - Marco ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39410/#review103208 ----------------------------------------------------------- On Oct. 23, 2015, 6:18 a.m., Artem Harutyunyan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/39410/ > ----------------------------------------------------------- > > (Updated Oct. 23, 2015, 6:18 a.m.) > > > Review request for mesos, Adam B, Joris Van Remoortere, Joseph Wu, Marco > Massenzio, and Vinod Kone. > > > Bugs: MESOS-3468 > https://issues.apache.org/jira/browse/MESOS-3468 > > > Repository: mesos > > > Description > ------- > > Added support for github to apply-reviews.py. > > > Diffs > ----- > > support/apply-reviews.py PRE-CREATION > > Diff: https://reviews.apache.org/r/39410/diff/ > > > Testing > ------- > > Tested with python 2.7 > > > Thanks, > > Artem Harutyunyan > >