[Mailman-Developers] [Mailman-checkins] [Branch ~mailman-coders/mailman/3.0] (no title)

Mark Sapiro msapiro at value.net
Thu Jun 28 20:30:37 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry Warsaw wrote:
> Hi Mark, thanks for fixing this.  Just a couple of quick comments...

>>          private = config.PRIVATE_ARCHIVE_FILE_DIR
>> -        if path == private or (os.path.commonprefix((path,
>> private)) == private
>> -                               and os.path.split(path)[1] ==
>> 'database'):
>> -            continue
>> -        # The directories under qfiles should have a more limited
>> permission
>> -        if os.path.commonprefix((path, config.QUEUE_DIR)) ==
>> config.QUEUE_DIR:
>> +        if path == private or \
>> +                  (os.path.commonprefix((path, private)) == private
>> +                   and os.path.split(path)[1] == 'database'):
> 
> This is probably better style:
> 
>          if path == private or (
>              os.path.commonprefix((path, private)) == private
>              and os.path.split(path)[1] == 'database'):
>              # then...
>              targetperms = PRIVATEPERMS
> 
> It eliminates a backslash (always ugly ;) though it kind of begs for
> the 'then...' comment because of the way the columns line up.
> 
>> +            targetperms = PRIVATEPERMS
>> +        elif os.path.commonprefix((path, config.QUEUE_DIR)) \
>> +              == config.QUEUE_DIR:
>>              targetperms = QFILEPERMS
> 
> Similarly, this removes the need for a backslash:
> 
>          elif (os.path.commonprefix((path, config.QUEUE_DIR))
>                == config.QUEUE_DIR):
>              targetperms = QFILEPERMS
> 
> You probably can't do much better without storing config.QUEUE_DIR in
> a local variable.


Thanks Barry,

I thought about this a bit, but clearly didn't think it through. I'll
clean it up.

/Mark

- --
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFGg/5NVVuXXpU7hpMRAguhAJ9X9PpO8yhZqQ40vi5cfjCKCnmodQCg7/Ph
GQxqjG/MfwJWFZYflqvaTnI=
=EWWb
-----END PGP SIGNATURE-----


More information about the Mailman-Developers mailing list