replacing \n characters in a hash
Steve Holden
steve at holdenweb.com
Thu Jan 26 10:31:35 EST 2006
Johhny wrote:
> Hello,
>
> Here is the code (minus my details section).
>
> server = xmlrpclib.ServerProxy(url)
>
> session = server.auth.login(username,password)
>
> #functions.
>
> def getErrata():
>
> channel_label = 'rhel-i386-as-4'
>
> errata =
> server.channel.software.list_errata(session,channel_label,start_date,end_date)
>
> return errata
>
>
>
> def getPackage(advisory):
>
> Package = server.errata.get_details(session,advisory)
>
> return Package
>
>
>
> errata = getErrata()
>
> for vals in errata:
>
> print "%s\t\t%s\t\t%s\t%s\t%s" %
> (vals['errata_advisory'],vals['errata_issue_date'],vals['errata_update_date'],vals['errata_last_modified_date'],vals['errata_type'],)
>
> errata_info = getPackage(vals['errata_advisory'],)
>
> print errata_info['errata_topic']
>
> errata_package = errata_info['errata_topic']
errata_package = errata_info['errata_topic'].replace('\n', " ")
>
> print getPackage(vals['errata_advisory'])
>
> I have not got any of the section in to replace the \n's as I was
> trying to work out why its not seeing what I thought was a string as a
> dict.
>
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
More information about the Python-list
mailing list