<br><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-10-10
14:11:37:<br>
<br>
> <br>
> <br>
> Guo Lian Yun wrote: </font></tt>
<br><tt><font size=2>> <br>
> libvirt-cim-bounces@redhat.com wrote on 2008-10-09 23:15:10:<br>
> <br>
> > > +bug = "00007"<br>
> > > +expr_values = {<br>
> > > +              "invalid_ccname"
: {"rc" : pywbem.CIM_ERR_NOT_FOUND, \<br>
> > > +                
 "desc" : "No such instance (CreationClassName)"},<br>
> > > +              "invalid_name"
  : {"rc" : pywbem.CIM_ERR_NOT_FOUND, \<br>
> > > +                
 "desc" : "No such instance (Name)"}<br>
> > > +             }<br>
> > <br>
> > Can you align the lines so that the colons line up.  Like:
<br>
> <br>
>   Sure. I will rewrite it.<br>
> > <br>
> > "invalid_ccname" : {"rc" : pywbem.CIM_ERR_NOT_FOUND,
\<br>
> >            "desc" : "No
such instance (CreationClassName)"},<br>
> > <br>
> > Also, remove the \ at the end of these lines above.<br>
> > <br>
> > > +    ret =  try_assoc(conn, classname, assoc_classname,
keys, \<br>
> > <br>
> > Remove \ at the end of the line.<br>
> > <br>
> > > +    ret = try_assoc(conn, classname, assoc_classname,
keys, \<br>
> > <br>
> > Same here - remove the \ at the end of the line.<br>
> > <br>
>   Would you please tell me when I have to add \ at the end of
line? <br>
> And when it doesn't <br>
>   need. <br>
>   </font></tt>
<br><tt><font size=2>> It would be easy to tell you where we need not
have to add a \ than <br>
> where to add it :).<br>
> We dont have to add a \ after a comma in case of functions or in <br>
> case of lists or dictionary above.<br>
> for ex in case of the above try_assoc() we do not need a \ after the<br>
> keys param.<br>
> We need to add a \ at the end of the line only in case we cannot <br>
> complete the statement within 80 columns.<br>
> <br>
> For ex:</font></tt>
<br><tt><font size=2>> logger.error("HostedService associator should
NOT return excepted <br>
> result with a wrong key name and value of %s input" % k)<br>
> <br>
> The above log stmt would not fit in the 80 columns in a single line
<br>
> and hence we would require the stmt to be continued on the next <br>
> line, we can do it using the \ as below:<br>
> <br>
> logger.error("HostedService associator should NOT return excepted
<br>
> result with \<br>
> a wrong key name and value of %s input" % k)<br>
> <br>
> But in case you do not want to use the \ you can write the above in
<br>
> the following way<br>
> <br>
> logger.error("HostedService associator should NOT return excepted
<br>
> result with "<br>
>              "a wrong key
name and value of %s input" % k)<br>
> <br>
> The same thing applies if the element of the list does not <br>
> accommodate in a single line within 80 columns.<br>
> <br>
> For ex:<br>
> <br>
> expr_values = { "invalid_ccname" : {"rc"  :
pywbem.CIM_ERR_NOT_FOUND, <br>
>                    
                "desc":
"No such instance "\<br>
> (CreationClassName)"}}<br>
> <br>
> For ex above we do not need a \ after the value pywbem.<br>
> CIM_ERR_NOT_FOUND of rc key in the list. But we would require a \
to<br>
> complete the value "No such instance (CreationClassName)"<br>
> of the key desc above.<br>
> Again, as in the logger stmt we can write the above without the \
as follows:<br>
> <br>
> expr_values = { "invalid_ccname" : {  "rc"
: pywbem.CIM_ERR_NOT_FOUND,<br>
>                    
                "desc"
: "No such instance "<br>
>                    
                     
 "(CreationClassName)"}}<br>
> <br>
> The rule of using \ applies almost like in the C language, for ex
in<br>
> the pre processor stmts we make use of the \ if we are not able to
<br>
> complete the stmt in a single line.<br>
> But we dont use it in case of function parameters distributed over
2<br>
> different lines.<br>
> <br>
> Hope this helps.</font></tt>
<br>
<br><tt><font size=2>  Deepti,</font></tt>
<br>
<br><tt><font size=2>  I'm much grateful of your explanation. It's
really helpful to me.</font></tt>
<br>
<br><tt><font size=2>  Thanks!</font></tt>
<br><tt><font size=2>  </font></tt>
<br><tt><font size=2>  <br>
> <br>
> Thanks and Regards,<br>
> Deepti.<br>
</font></tt>
<br><tt><font size=2>> <br>
>   Thanks!<br>
> > -- <br>
> > Kaitlin Rupert<br>
> > IBM Linux Technology Center<br>
> > kaitlin@linux.vnet.ibm.com<br>
> > <br>
> > _______________________________________________<br>
> > Libvirt-cim mailing list<br>
> > Libvirt-cim@redhat.com<br>
> > https://www.redhat.com/mailman/listinfo/libvirt-cim</font></tt>
<br><tt><font size=2>> <br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> https://www.redhat.com/mailman/listinfo/libvirt-cim<br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> https://www.redhat.com/mailman/listinfo/libvirt-cim</font></tt>