[PATCH] samba-tool processes: Make the output a bit nicer

Ricky Nance ricky.nance at weaubleau.k12.mo.us
Thu Dec 6 05:54:42 MST 2012


Michael thanks for the comments, I didn't realize that about .format (what
I had read said for versions lower than 3). I thought I had vi setup to
report the extra spaces, I will have to look into why thats not working as
expected now. Anyway with your revisions here is the new patch.

Ricky


On Thu, Dec 6, 2012 at 3:13 AM, Michael Wood <esiotrot at gmail.com> wrote:

> Hi Ricky
>
> On 6 December 2012 08:12, Ricky Nance <ricky.nance at weaubleau.k12.mo.us>
> wrote:
> > This patch makes samba-tool processes output like:
> >
> > Service:    PID
> > ---------------------------------------
> > dnsupdate          25964
> > nbt_server         25954
> > cldap_server       25958
> > winbind_server   25961
> > kdc_server         25959
> > samba                  0
> > dreplsrv           25960
> > kccsrv             25963
> >
> > (it looks nicer in a terminal)
> >
> > I also removed the newline if you use the --name or --pid option as print
> > already gives a newline, so IF someone were to write a script that uses
> > this it won't have the extra newline now.
>
> This looks good, but I have a couple of comments:
>
> "...".format() doesn't appear to work on Python 2.5 and below.  There
> are still people that occasionally pop up on the list trying to use
> Python 2.4, so it seems it would be a better idea to use something
> like this:
>
> print "%-16s %6d" % (name.name, server_id.pid)
>
> Otherwise, some possible nit picks :)
>
> All the other strings in the patch use double quotes, but the one with
> the .format() uses single quotes.
>
> Also, I think it might be a good idea to avoid the tabs in the output
> and just use spaces.
>
> The print statement with the .format() is indented 5 spaces more than
> the previous line instead of the usual 4.
>
> Regards,
> Michael
>
> --
> Michael Wood <esiotrot at gmail.com>
>



--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-samba-tool-processes-Make-the-output-a-bit-neater.patch
Type: application/octet-stream
Size: 1715 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121206/8a00e4f2/attachment.obj>


More information about the samba-technical mailing list