Re: [PATCH] gitview: revamped to use string.join, stripped a function def

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"rae l" <crquan@xxxxxxxxx> writes:

> Please give some comments.
>
> On Sep 28, 2007 3:55 AM, Denis Cheng <crquan@xxxxxxxxx> wrote:
>> Signed-off-by: Denis Cheng <crquan@xxxxxxxxx>

Blast from the past ;-).

>> -def list_to_string(args, skip):
>> -       count = len(args)
>> -       i = skip
>> -       str_arg=" "
>> -       while (i < count ):
>> -               str_arg = str_arg + args[i]
>> -               str_arg = str_arg + " "
>> -               i = i+1
>> -
>> -       return str_arg
>> ... 
>>                 """Fill in different windows with info from the reposiroty"""
>> -               fp = os.popen("git rev-parse --sq --default HEAD " + list_to_string(args, 1))
>> +               fp = os.popen("git rev-parse --sq --default HEAD " + " ".join(args[1:]))

Obviously correct, loses extra SPs on both ends of the args
string, and reads more Pythonic.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux