Re: [389-users] dsadmin python library - using signature to document methods

2013-03-20 Thread Rich Megginson

On 03/18/2013 10:08 AM, Roberto Polli wrote:

Hi Rich,

what do you think about using function signature to improve method
documentation?

Ex. in def setupReplica(self, args): we
  1- have to document the whole args behavior
  2- need to setup default values with args.get(name, defaultvalue)

I think that the following signature is cleaner:
1- def setupReplica(suffix, binddn, rtype=MASTER_TYPE, legacy=False, rid=None)
2- get rid of args.get with default values using eg.
suffix, rtype, legacy, binddn, rid = map(args.get 'suffix type legacy binddn
id'.split())

Moreover the **magic applied to a dict, still allows us to call
setupReplica(**args)


That sounds fine.



Let me know + Peace,
R.
---
Roberto Polli
Community Manager
Babel S.r.l. - http://www.babel.it
T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680
P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma)

CONFIDENZIALE: Questo messaggio ed i suoi allegati sono di carattere
confidenziale per i destinatari in indirizzo.
E' vietato l'inoltro non autorizzato a destinatari diversi da quelli indicati
nel messaggio originale.
Se ricevuto per errore, l'uso del contenuto e' proibito; si prega di
comunicarlo al mittente e cancellarlo immediatamente.


--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

Re: [389-users] dsadmin python library - about Entry behavior

2013-03-20 Thread Rich Megginson

On 03/18/2013 08:37 AM, Roberto Polli wrote:

Hi Rich,

a question about Entry behavior.

Given the following entry:
t = 'o=foo', {'objectclass': ['organization', 'top']}
e = Entry(t)

Use dict.update would be very nice, but if you try
e.data.update({'dc': 'bar', 'objectclass':['organization', 'top', 'domain']})

you'll end up with a strange result.

Do you think we should raise an exception if dict.values are strings?

Sure.


Peace,
R:




--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

Re: [389-users] dsadmin python library

2013-03-20 Thread Rich Megginson

On 03/14/2013 11:11 AM, Roberto Polli wrote:

On Thursday 14 March 2013 11:04:46 Rich Megginson wrote:

What about the scripts such as dirsynccrtl.py, winsyncssl.py, etc. that
use dsadmin.py?  Should they be in the same repo as dsadmin.py?

your choiche ;)

I would just separate the "reusable" stuff from the perl and bug one.


will see



I really hope that  dsadmin.py & co will be added to 389 rpm as soon as we end
a small facelift.

That's a much larger task - will then need documentation, QE, etc., etc.


Peace,
R.


--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

Re: [389-users] dsadmin python library - using signature to document methods

2013-03-18 Thread Roberto Polli
Hi Rich,

what do you think about using function signature to improve method 
documentation?

Ex. in def setupReplica(self, args): we
 1- have to document the whole args behavior
 2- need to setup default values with args.get(name, defaultvalue)

I think that the following signature is cleaner:
1- def setupReplica(suffix, binddn, rtype=MASTER_TYPE, legacy=False, rid=None)
2- get rid of args.get with default values using eg.
suffix, rtype, legacy, binddn, rid = map(args.get 'suffix type legacy binddn 
id'.split())

Moreover the **magic applied to a dict, still allows us to call 
setupReplica(**args) 

Let me know + Peace,
R.
---
Roberto Polli
Community Manager
Babel S.r.l. - http://www.babel.it
T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680
P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma)

CONFIDENZIALE: Questo messaggio ed i suoi allegati sono di carattere 
confidenziale per i destinatari in indirizzo.
E' vietato l'inoltro non autorizzato a destinatari diversi da quelli indicati 
nel messaggio originale.
Se ricevuto per errore, l'uso del contenuto e' proibito; si prega di 
comunicarlo al mittente e cancellarlo immediatamente.
--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

Re: [389-users] dsadmin python library

2013-03-14 Thread Roberto Polli
On Thursday 14 March 2013 11:04:46 Rich Megginson wrote:
> What about the scripts such as dirsynccrtl.py, winsyncssl.py, etc. that
> use dsadmin.py?  Should they be in the same repo as dsadmin.py?
your choiche ;) 

I would just separate the "reusable" stuff from the perl and bug one.

I really hope that  dsadmin.py & co will be added to 389 rpm as soon as we end 
a small facelift.

Peace,
R.
-- 
Roberto Polli
Community Manager
Babel S.r.l. - http://www.babel.it
T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680
P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma)

CONFIDENZIALE: Questo messaggio ed i suoi allegati sono di carattere 
confidenziale per i destinatari in indirizzo.
E' vietato l'inoltro non autorizzato a destinatari diversi da quelli indicati 
nel messaggio originale.
Se ricevuto per errore, l'uso del contenuto e' proibito; si prega di 
comunicarlo al mittente e cancellarlo immediatamente.
--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

[389-users] dsadmin python library

2013-03-12 Thread Roberto Polli
Hi Rich,

why don't move the useful dsadmin python library in a separate repo?

I could contribute:
 * doc
 * code refactoring with new-style classes
 * some more exception stuff

Let me know + Peace,
R.
-- 
Roberto Polli
Community Manager
Babel S.r.l. - http://www.babel.it
T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680
P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma)

CONFIDENZIALE: Questo messaggio ed i suoi allegati sono di carattere 
confidenziale per i destinatari in indirizzo.
E' vietato l'inoltro non autorizzato a destinatari diversi da quelli indicati 
nel messaggio originale.
Se ricevuto per errore, l'uso del contenuto e' proibito; si prega di 
comunicarlo al mittente e cancellarlo immediatamente.
--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users