Danek Duvall wrote:
> On Thu, Nov 06, 2008 at 03:35:31PM -0800, Rich Burridge wrote:
>
>>> - line 98: Shouldn't this simply be tokens[0]?  Likewise on 99, tokens[1]?
>>>   Or just "category, sub_category = tokens"?
>> No, because it needs to remove the initial and trailing double quotes
>> (which should be present on all classification lines because of the
>> previous classification work I did):
>
> Ah, quotes.  Then please call .strip('"') on the string instead of assuming
> they're there.

Okay. Rather than generate a new webrev just for this, are you okay with:

91         tokens = line.split(None, 1)[1].split("/")


becoming:

91         tokens = line.split(None, 1)[1].strip('"').split("/")


?

Seems to work just fine:

$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> line='classification "System/Hardware"'
 >>> tokens = line.split(None, 1)[1].strip('"').split("/")
 >>> print tokens
['System', 'Hardware']
 >>> newline='classification Applications/Internet'
 >>> newtokens = newline.split(None, 1)[1].strip('"').split("/")
 >>> print newtokens
['Applications', 'Internet']
 >>>

Thanks.

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to