[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Spacewalk-devel] RFE: spacecmd: patches for printing function results and performing diff on some spacewalk components



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 11.05.2012 00:06, schrieb Steven Hardy:
[...]
>> First, I've a question about ret Most of my changes are none 
>> intrusive, however there is a behavior of spacecmd I'd like to 
>> change: currently, the do-functions normally have no return
>> values at all. Because some of these functions are used by other
>> function, a lot of them have an additional parameter "doreturn =
>> False". If this is set to true, the result is not printed to
>> stdout, but instead return as list of strings.
>> 
>> As a results, some code inside the do-functions is duplicated. 
>> Because the new functionality I've created uses some functions 
>> that currently do not provide a way to return there results, I'd 
>> like to suggest following approach: instead of doing this 
>> differentiation inside each function, the functions should
>> always return there result as list of strings. If printing is
>> required, meaning, the function is not called from outside and
>> not from another function, the printing is done by
>> shell.py:postcmd, which will be called after all commands called
>> from command line.
>> 
>> If a function return a list of string, these will be printed to 
>> stdout. If not, it behaves like before. There is no immediate
>> need to change the existing function, but of course, this would
>> make the code cleaner.
> 
> I suspect this will be quite tricky to do without breaking lots of 
> stuff, for example what happens to interactive operation in your
> new scheme?

I'm not sure, what you mean be this. Normal interactive operation will
work.

Jörg

- -- 
  Jörg Steffens            joerg steffens dass-it de
  dass IT GmbH             Phone: +49.221.3565666-91
  http://www.dass-IT.de      Fax: +49.221.3565666-10

 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRB52500
 Geschäftsführer: S. Dühr, M. Außendorf, Jörg Steffens, P. Storz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+svwMACgkQebMQ0f2L2xv8DwCgp0NwRoiaAN3eMQ6cHFRY3TUs
b7kAmwXFReQ48rCrmO95Zir/LPJIZSY2
=Z8XW
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]