[18:50] <tsimonq2> hi, I have a question about the API
[18:50] <tsimonq2> I am looking to build an app that scans certain packages in the supported releases of Ubuntu for new versions and if so, then prints a message
[18:51] <tsimonq2> is there a way in the API to see a package version?
[18:52] <tsimonq2> I see the entry for Xenial, with it being the current release, but how about implementing Trusty, Vivid, and Wily?
[18:52] <tsimonq2> if someone could get back to me soon, that would be great. THanks!
[18:52] <cjwatson> I would suggest using https://launchpad.net/+apidoc/devel.html#archive-getPublishedSources with order_by_date=True, and work backward until you hit stuff you've previously seen (being aware that you might see the same publication twice)
[18:52] <cjwatson> trusty, vivid, and wily are perfectly well implemented :)
[18:53] <tsimonq2> cjwatson: all I see is current_version, what about calling it for those previous codenames?
[18:53] <cjwatson> current_version on what object, please?
[18:54] <cjwatson> there is no object with an attribute by that name on the API
[18:54] <cjwatson> do you mean current_series?
[18:54] <tsimonq2> this is my current code: https://raw.githubusercontent.com/tsimonq2/lububot/master/test.py
[18:54] <tsimonq2> I have to go now, I will be back in a couple of hours, please let me know
[18:54] <tsimonq2> thank you
[18:54] <cjwatson> tsimonq2: use ubuntu.getSeries(name_or_version='wily') etc.
[18:55] <tsimonq2> ok, thanks
[18:55] <cjwatson> tsimonq2: that code will be extremely very very very slow on lots of packages
[18:55] <tsimonq2> hmm pok
[18:55] <cjwatson> I mean, if you're calling it on lots of packages
[18:55] <tsimonq2> s/pok/ok/
[18:55] <cjwatson> many many round trips
[18:55] <tsimonq2> yep :)
[18:55] <cjwatson> if it's only a few, that's ok
[18:55] <tsimonq2> I have a plan ;)
[18:55] <cjwatson> but if you're intending to check lots of packages, my recommendation above standas
[18:56] <cjwatson> *stands
[18:56] <cjwatson> archive.getPublishedSources(order_by_date=True, status="Published") and iterate
[18:57] <cjwatson> also, you should probably be using status="Published" in any case
[23:10] <tsimonq2> cjwatson: hmm, what if I wanted to do a lot of packages?
[23:10] <tsimonq2> cjwatson: any faster alternative?
[23:12] <cjwatson> tsimonq2: so, for that you're going to need to explain a bit more about exactly what your app is going to do
[23:14] <tsimonq2> cjwatson: I would like my app(Python) to idle and print the package name when there is an update to a large amount of packages
[23:14] <tsimonq2> or to that package
[23:14] <tsimonq2> so when a package gets an update, I want an output
[23:15] <tsimonq2> similar to queuebot
[23:16] <sarnold> isn't there a -changes mail list of some sort that publishes updates and new packages?
[23:16] <sarnold> e.g. https://lists.ubuntu.com/mailman/listinfo/trusty-changes
[23:16] <cjwatson> tsimonq2: so, there aren't currently good solutions that don't involve polling, but if you're prepared to poll every n minutes or something, then I gave you the faster alternative above - archive.getPublishedSources(order_by_date=True) basically tells you about everything recent in the archive, a bit like a fairly stupid RSS feed, and you walk back through it until you reach the thing you last heard of or a date cut-off
[23:17] <cjwatson> (or, yes, if you're prepared to subscribe to a mailing list as part of this then you can do that, but that's cumbersome from an app
[23:17] <cjwatson> )
[23:17] <tsimonq2> cjwatson: but then how would I parse that for the packages that I want?
[23:18] <wgrant> What do you mean?
[23:18] <cjwatson> tsimonq2: each entry in the collection is a source_package_publishing_history, so you look at the source_name attribute or whatever it's called
[23:18] <wgrant> It returns a list of entries, and you'd check the package name in each.
[23:18] <cjwatson> you don't need to "parse"
[23:18] <tsimonq2> oh
[23:18] <tsimonq2> ok
[23:19] <cjwatson> now, if you're planning for this app to be installed on lots and lots of systems, er, please warn us
[23:19] <cjwatson> 'cos maybe we want something more scalable in that kind of case ...
[23:19] <tsimonq2> cjwatson: no, actually I plan on this being an IRC bot
[23:19] <cjwatson> (and you want status="Published" on that too, so that you don't get entries for things that are superseded etc.)
[23:20] <cjwatson> right, this should be fine for an IRC bot.  it's what the ddebs.ubuntu.com publishing backend uses to keep up with the archive
[23:20] <tsimonq2> cjwatson: so I want it to be as frequent as possible updates for that
[23:20] <cjwatson> and indeed we designed it for that purpose
[23:21] <tsimonq2> cjwatson: so as I am not that familiar with working with APIs, how would I carry out that task(in code terms)?
[23:24] <tsimonq2> cjwatson: so maybe source_package_publishing_history.sourcename?
[23:25] <tsimonq2> cjwatson: or what?
[23:28] <tsimonq2> cjwatson: but more specifically, when using the docs, how do I use the URLs given?
[23:30] <tsimonq2> cjwatson: I just lack this knowledge, so if you could point me in the right direction, that would be awesome
[23:36] <tsimonq2> or anyone else
[23:39] <wgrant> tsimonq2: https://help.launchpad.net/API/launchpadlib
[23:47] <tsimonq2> wgrant: thank you
[23:53] <sarnold> https://bugs.launchpad.net/aptdaemon/+bug/659438 got some spam and fairly impolite replies from users; can this bug be made silent in some fashion? perhaps https://launchpad.net/~tegosfentasio and https://launchpad.net/~jc4 and https://launchpad.net/~ishani-infoware don't need to participate in launchpad any more either (comments 170, 172, 174)
[23:54] <wgrant> sarnold: Well that's pretty spectacular.
[23:55] <sarnold> pleasant people all around, right?
[23:55] <wgrant> sarnold: I've removed the comments, let me know if it continues.
[23:55] <wgrant> Indeed.
[23:55] <sarnold> wgrant: thanks!
[23:55] <wgrant> And all from some innocuous spam.
[23:56] <sarnold> no kidding; even without understanding ukranian it was obviously spam.. sigh.