mass subscriptions

As you may be aware, Lubuntu is transitioning from GTK to Qt graphics libraries, which means a transition from LXDE to LXQt. Same people, more or less, just different libs. Of course, every component is different. We finally have packages in Debian and Ubuntu Xenial. There's even instructions on how to install them!

We needed to subscribe our Lubuntu Packages Team to all of these bug mails. Sure, we could have went to 18 different source package pages and just clicked our way to it, but that kind of takes a darn while.

Luckily there's a solution: launchpadlib. Just a pip install away (or use package python-launchpadlib), it gives you all sorts of control over and access to Launchpad data. It's almost better than using the web interface! Well, assuming you're fine with Python.

In our case here, it's possible to simply name a team and/or person and give it a list of packages and have it subscribe them all. Takes a few seconds after you have the code, which you can find here. The meat of the code is one line:

lp.distributions['ubuntu'].getSourcePackage(name=filearray[i]).addBugSubscription(subscriber=lp.people[teamtowrite])

which is basically like saying for a particular source package in the Ubuntu project, add a bug subscription for the particular team or person. Heck, it almost reads like normal English.

This might be useful for normal people, too. Say you wanted to subscribe to all the bugs for a particular set of packages you're helping to develop. It'd be great for that.

More than anything, it shows the power of the Launchpad API and the hard work that Colin and the rest of the Launchpad team put into it!

With that, I'd like to especially thank cjwatson, dobey, and wgrant, whom were all helpful in figuring this out on IRC, as well as tsimonq2, who was responsible for the majority of the code.

Read and Post Comments

reddit spritesheet CSS magic

So you've got yourself a subreddit. Now you need to configure it. Boy, what a hard time /r/lubuntu had trying to get flair figured out. Unfortunately, the reddit group is our newest channel to connect with the larger community, so I didn't have a lot of help.

See the issue was that we already had this spritesheet created by our Artwork God, Rafael Laguna. He actually had made another one to make this fantastic stylesheet, using Naut (look at that winking Snoo!), so I was confident this would be easy.

However, I had quite a bit of problems trying to get background-position to behave right. It looked like it was going all over the place. In looking at tutorials, none of them, even the most helpful, covered what to do if you have a spritesheet. Instead, they all assume you just have individual images.

There were several problems I had going on including extra padding and incorrectly sized images on the spritesheet that created issues. The spritesheet was remade with more Lubuntu specific images (well, at least for half of them).

Lubuntu spritesheet

Making it a single row of equal-sized (16x16) images made things easier. The ah ha moment came when realizing that background-position moves the background relative to the canvas. It does NOT move the background on the canvas. So we needed to use negative numbers and all was well.

And yet, there was another problem: there's optional text that can go with the flair. Unfortunately, it was included in the span that was styled with our background spritesheet. It was appearing right on top of the flair and there was no way around this looking at the HTML.

<span class="flair flair-lxqt" title="Release Mgr. | QA Head">Release Mgr. | QA Head</span>
::before
"Release Mgr. | QA Head"
</span>

Enter the ::before pseudo element. Note I didn't say selector. The following code creates an an element that sits before the element that it acts on, which is, in this case, the flair class. So before we see any flair things, we have an blank element that is 4 pixels away from the flair class (which includes the image and the text) and and that is 4 pixels away from the next element, which happens to be the text. It also makes sure that our spritesheet is in there and that we're selecting 16x16 bits of it.

.flair::before {
margin: 0 4px 0 4px;
display: inline-block;
content:"";
background: url(%%reddit-sprite%%) no-repeat scroll top left;
min-width: 16px;
min-height: 16px;
}

And lastly, we need the specific positioning. Remember that the element that has the margin and everything is the pseudo element, so we need to use ::before on these as well. We'll also make sure to use the specific classes we created in the "edit flair" option in reddit Moderation Tools, so that we can act specifically on these.

.flair-lxde::before { background-position: 0px 0px !important; }
.flair-lxqt::before { background-position: -16px 0px !important; }
.flair-lenny::before { background-position: -32px 0px !important; }
.flair-user::before { background-position: -48px 0px !important; }
.flair-invader::before { background-position: -64px 0px !important; }
.flair-orb::before { background-position: -80px 0px !important; }

I basically hacked this together through inspecting elements at r/PixelDungeon (which is currently my favourite roguelike game and one that I hope to rewrite using Python and Kivy, if anyone's interested in helping) since they have all sorts of fantastic functionality going on. Kudos to them.

I do hope this helps save someone the sanity that I lost yesterday. ;)

Read and Post Comments

happy Ubuntu Community Appreciation Day, phillw!

I swear, I find out about some new event Ubuntu does every day. How is it that I've been around Ubuntu for as long as I have and I've only now heard about this?

Well, in any case, today is Ubuntu Community Appreciation Day, where we give thanks to the humans (remember, ubuntu means humanity!) that have so graciously donated their time to make Ubuntu a reality.

I have a lot of people to thank in the community. We have some really exceptional people about. I really feel like I could make the world's longest blog post just trying to list them all. Several folks already have!

Instead, I'll point out a major player in the community who is pretty unseen these days.

Phill Westside was a major contributor to Lubuntu. He was there when I first came to #lubuntu so many moons ago. His friendly, inviting demeanour was one of the things that kept me sticking around after my support request was met. Phill took it upon himself to encourage me just as he had with others and slowly I came to contribute more and more.

Sadly, some people in high rankings in the community failed to see Phill's value for whatever reason. I'm not sure I totally understand but I think the barrage of opinions that came from Jono Bacon's call for reform in Ubuntu governance may offer some hint. Phill's no longer an Ubuntu member and is rarely seen in the typical places in the community.

Yet he still helps out on #lubuntu, still helps with Lubuntu ISO testing, still reposts Lubuntu news on Facebook, still contributes to the Lubuntu mailing lists, still tries to help herd the cats as it were, though he's handed off titles to others (that's how I'm the Release Manager and Head of QA!). tl;dr, Phill is still a major contributor to Ubuntu.

Did I mention he's a great guy to hang out with, too? I've never met him face to face, but I'm sure if I did, I'd give him one heck of a big ole hug.

Thanks, Phill!

Read and Post Comments