[Mailman-Users] Re: How to determine moderation flag from config.pck

2023-08-22 Thread Russell Clemings
For the benefit of the archives, here's what I ended up doing:

if ($key_value[1] & 128) {
  $key_value[1] = 1; // moderated
}
else {
  $key_value[1] = 0; // not moderated
}

$key_value[1] being the second part of the user_options field in
config.pck, after I turned it into an array:
'rclemings+authu...@gmail.com': 408,

rac

On Tue, Aug 22, 2023 at 5:11 PM Russell Clemings 
wrote:

> That does it, thanks.
>
> rac
>
> On Tue, Aug 22, 2023 at 3:06 PM Mark Sapiro  wrote:
>
>> On 8/22/23 2:50 PM, Russell Clemings wrote:
>> > What's the logic behind that? I should have mentioned that I'll be doing
>> > this in PHP so I'll have to replicate it.
>>
>>
>> It works the same in PHP. See
>> https://www.php.net/manual/en/language.operators.bitwise.php
>>
>> --
>> Mark Sapiro The highway is for gamblers,
>> San Francisco Bay Area, Californiabetter use your sense - B. Dylan
>>
>> --
>> Mailman-Users mailing list -- mailman-users@python.org
>> To unsubscribe send an email to mailman-users-le...@python.org
>> https://mail.python.org/mailman3/lists/mailman-users.python.org/
>> Mailman FAQ: http://wiki.list.org/x/AgA3
>> Security Policy: http://wiki.list.org/x/QIA9
>> Searchable Archives:
>> https://www.mail-archive.com/mailman-users@python.org/
>> https://mail.python.org/archives/list/mailman-users@python.org/
>> Member address: rclemi...@gmail.com
>>
>
>
> --
> ===
> Russell Clemings
> 
> ===
>


-- 
===
Russell Clemings

===
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@jab.org


[Mailman-Users] Re: How to determine moderation flag from config.pck

2023-08-22 Thread Russell Clemings
That does it, thanks.

rac

On Tue, Aug 22, 2023 at 3:06 PM Mark Sapiro  wrote:

> On 8/22/23 2:50 PM, Russell Clemings wrote:
> > What's the logic behind that? I should have mentioned that I'll be doing
> > this in PHP so I'll have to replicate it.
>
>
> It works the same in PHP. See
> https://www.php.net/manual/en/language.operators.bitwise.php
>
> --
> Mark Sapiro The highway is for gamblers,
> San Francisco Bay Area, Californiabetter use your sense - B. Dylan
>
> --
> Mailman-Users mailing list -- mailman-users@python.org
> To unsubscribe send an email to mailman-users-le...@python.org
> https://mail.python.org/mailman3/lists/mailman-users.python.org/
> Mailman FAQ: http://wiki.list.org/x/AgA3
> Security Policy: http://wiki.list.org/x/QIA9
> Searchable Archives:
> https://www.mail-archive.com/mailman-users@python.org/
> https://mail.python.org/archives/list/mailman-users@python.org/
> Member address: rclemi...@gmail.com
>


-- 
===
Russell Clemings

===
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@jab.org


[Mailman-Users] Re: How to determine moderation flag from config.pck

2023-08-22 Thread Mark Sapiro

On 8/22/23 2:50 PM, Russell Clemings wrote:

What's the logic behind that? I should have mentioned that I'll be doing
this in PHP so I'll have to replicate it.



It works the same in PHP. See 
https://www.php.net/manual/en/language.operators.bitwise.php


--
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
   https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@jab.org


[Mailman-Users] Re: How to determine moderation flag from config.pck

2023-08-22 Thread Russell Clemings
What's the logic behind that? I should have mentioned that I'll be doing
this in PHP so I'll have to replicate it.

On Tue, Aug 22, 2023, 2:46 PM Mark Sapiro  wrote:

> On 8/22/23 1:53 PM, Russell Clemings wrote:
> > I'm trying to figure out how to extract the moderation flag for each user
> > in a list's config.pck file.
> >
> > I know from Defaults.py that it's in the "Bitfield for user options"
> > section (below). But for a config.pck with the following:
> >
> > 'user_options': {'rclemings+20230...@gmail.com': 296,
> >   {'rclemings+20230...@gmail.com': 296,
> >   'rclemings+authu...@gmail.com': 408,
> >   'rclemi...@gmail.com': 328},
> >
> > How can I tell which ones are moderated? Automatically, I mean.
> >
> > I know the "moderated" value is 128, but I don't understand how (or if
> it's
> > even possible) to pull out the value for a single flag.
>
>
> For example, in Python
> ```
> for user, opts in user_options.items():
>  if opts & 128:
>  print(user + ' is moderated')
> ```
>
> --
> Mark Sapiro The highway is for gamblers,
> San Francisco Bay Area, Californiabetter use your sense - B. Dylan
>
> --
> Mailman-Users mailing list -- mailman-users@python.org
> To unsubscribe send an email to mailman-users-le...@python.org
> https://mail.python.org/mailman3/lists/mailman-users.python.org/
> Mailman FAQ: http://wiki.list.org/x/AgA3
> Security Policy: http://wiki.list.org/x/QIA9
> Searchable Archives:
> https://www.mail-archive.com/mailman-users@python.org/
> https://mail.python.org/archives/list/mailman-users@python.org/
> Member address: rclemi...@gmail.com
>
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@jab.org


[Mailman-Users] Re: How to determine moderation flag from config.pck

2023-08-22 Thread Mark Sapiro

On 8/22/23 1:53 PM, Russell Clemings wrote:

I'm trying to figure out how to extract the moderation flag for each user
in a list's config.pck file.

I know from Defaults.py that it's in the "Bitfield for user options"
section (below). But for a config.pck with the following:

'user_options': {'rclemings+20230...@gmail.com': 296,
  {'rclemings+20230...@gmail.com': 296,
  'rclemings+authu...@gmail.com': 408,
  'rclemi...@gmail.com': 328},

How can I tell which ones are moderated? Automatically, I mean.

I know the "moderated" value is 128, but I don't understand how (or if it's
even possible) to pull out the value for a single flag.



For example, in Python
```
for user, opts in user_options.items():
if opts & 128:
print(user + ' is moderated')
```

--
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
   https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@jab.org