On Tue 08 Apr 2008 at 04:06PM, [EMAIL PROTECTED] wrote:
> > In these new commands the syntax seems to be different.  Why is that?
> 
> Stephen picked the command syntax.  I implemented it.
> 
> > Question 2: Could we see some sample output?
> 
> Sure.
> 
> $ pkg authority
>             AUTHORITY                            URL
>       awd (preferred)              http://awd:10000/
>                 mumak            http://mumak:10000/

Thanks.  Could we have this be:

AUTHORITY                     URL
awd                           http://awd:10000/
mumak                         http://mumak:10000/

That is slightly more conventional, and in line with the rest of the
command.  See more thoughts on this below.

> $ pkg authority awd mumak
>                             
> Authority: awd
> Origin URL: http://awd:10000/
> SSL Key: None
> SSL Cert: None
> Catalog Last Updated: 2008-02-21 13:08:40.860697
> 
> Authority: mumak
> Origin URL: http://mumak:10000/
> SSL Key: None
> SSL Cert: None
> Catalog Last Updated: 2008-04-02 00:01:58.368630

I would suggest manually padding with spaces, similar to info.

# pkg authority awd

      Authority: awd
     Origin URL: http://awd:10000/
        SSL Key: None
       SSL Cert: None
Catalog Updated: Wed Apr  2 13:08:40 2008

For "Catalog Last Updated" I would drop the "Last", and would prefer
ctime() so that the time is localized according to the conventions of
the current locale.  I think you can just do "dt.ctime()".

> Okay.  What does _() do, why do my strings need to be wrapped in this,
> and where can I read more about how this works?

I believe this is the convention so that we can ultimately do
localization.  My understanding is that it is (or will be) an analog to gettext.

> >       940 +                        if pfx == preferred_authority:
> >       941 +                                pfx += " (preferred)"
> >       942 +                                print "%15s %30s" % (pfx, url)
> >       943 +                        else:
> >       944 +                                print "%15s %30s" % (pfx, url)
> > 
> > Given that " (preferred)" is 12 characters in length, is the first column 
> > wide
> > enough?
> 
> I had no idea what the right choice was here, so I guessed.  If you'd
> like to suggest more sane options, I'd certainly take that advice.

Well, I'd guess:

len("opensolaris.org") + len(" (preferred)") + fudge factor.  So... 35?

Since the last column is to be left justified, there's now no need to
specify a width, so your printf string can become:  "%-35s %s"

> >       959 +                        print "\nAuthority: %s" % pfx
> >       960 +                        print "Origin URL: %s" % url
> >       961 +                        print "SSL Key: %s" % ssl_key
> >       962 +                        print "SSL Cert: %s" % ssl_cert
> >       963 +                        print "Catalog Last Updated: %s" % dt
> > 
> > Consider copying the output style of 'pkg info'?
> 
> No.  What aspects were you interested in seeing imitated?

See above.

> >      1013 +                ssl_key = os.path.abspath(ssl_key)
> > 
> > Why abspath()?  (os.path.exists() returns false for broken symlinks).
> 
> It's a present from Stephen.  Is os.path.exists() the approved way of
> doing this?

I may have misunderstood this code: Are we telling packaging "here is a
path to a certificate-- use that pathname to get the cert when you need
it?"  or:  "here is a path to a certificate, take a copy of it and file
it away?"

        -dp

-- 
Daniel Price - Solaris Kernel Engineering - [EMAIL PROTECTED] - blogs.sun.com/dp
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to