DBUS-reactor, or AsusOSD must die!
How to write a tiny python app (less than 50 lines) that reacts to events on the DBUS buses. For example, displaying a notification when you press one of your keyboards' special keys.
How to write a tiny python app (less than 50 lines) that reacts to events on the DBUS buses. For example, displaying a notification when you press one of your keyboards' special keys.
I wrote a while ago a RSS program called uRSSus. I expect I am the only user of it because it has some problems (all of them my fault ;-) but I really like it.
For a while now I have wanted it to have podcast support. The thing is... that always seemed like a lot of work. Sure, using phonon I can create an audio player and everything, but...
I am using a HTML widget to display the posts, so I would have to find a way to add the audio player to the UI and ... too much work.
So, today I woke up and thought... wait a minute... Qt's HTML widget is based on Webkit. And Webkit supports HTML5. And HTML5 has an "audio" tag.
So, if I fixed uRSSus to fetch the enclosure links, and added them in the database, and then added this to the post template:
<?py for enclosure in post.enclosures: ?> <audio autobuffer="Yes" controls="controls" src=#{enclosure.href}></audio><br> <?py #end ?>
Wouldn't that actually work? Well, yeah!
So there you have it, I was right not to implement it, because the easiest way is to let Qt do it ;-)
I have been a customer of Fibertel for my broadband needs for several years. Their service has not sucked bad, even if I had a few problems in the past.
However, a month ago, I decided to switch to a competing service for a good reason: it's much much much cheaper [1]
Since I am not stupid, I canceled late with Fibertel, so I would have a full month of overlapping service. I thought hey, maybe I would come back if the new service sucks [2]
What happened next has been increasingly annoying.
First Fibertel called the person who contracted the service (not me). That's reasonable.
Then they called me to ask me why I was cancelling. I exlained that the other service is (all things considered) about 75% cheaper for the same performance. I suppose that's reasonable too.
What started becoming less and less reasonable are the next 5 calls, each offering cheaper rates, but still more expensive than my new service.
What was not reasonable was that they started calling to tell me technically unsound bullshit to scare me into their service again.
What is definitely not reasonable is that they called me 6 times, even after I told them to stop calling me in the third call.
What is incredibly stupid and annoying was that they decided to block my internet access in order to show me an ad about the same offers I ALREADY DECLINED and until I clicked that ad I could not use the Internet.
What is freaking nuts is that because I have an access point I couldn't see the satan-damned ad, so I was left without internet until:
I removed the access point
Hooked my notebook to the cable modem
Got rejected by it
Hooked back the AP
Got the MAC from it
Faked my notebooks MAC
Clicked the Cthulhu-pissed ads
Hooked back the AP
Un-faked my MAC
So, I needed to spend an hour doing this.
Therefore, dear Fibertel, your company also provides cable TV. I am pissed at you. I have decided to buy service from DirecTV exclusively to piss you off.
Yup, I, who have been paying you every month $230 for years, will pay you $0 next month. I could have paid you $100, but no, you had to be asses about it. You couldn't let me go. Well, I do not like being pestered. I do not like that you acted like a spurned 17-year old [3]
Fibertel, I kinda liked you, but my opinion of you has gone lower.
Also, any Fibertel customers out there: if you ask to cancel the service saying you switch because of the price, they will offer you 3Mbps for a year for $79. If you say no, they will offer you 3 free months.
That's a $600 saving, so go ahead and take their money.
This is not really part of my PyQt by Example series but since it's a totally unrelated topic that would be impossible to connect to it, but is still a PyQt tutorial and shares the concept so, here it is.
No, this is not a post announcing I just wrote my first public python code. This is a post about my first public python code... from 1996!
In 1996, the soon-to-be-here year of the Linux desktop was fueled by one of the marquee open source applications of the time: LyX.
LyX was (is) a sort of word processor where you wrote and generated LaTeX which then produced whatever you used to print. But I am digressing: LyX was cool because it used one of the first good free graphical toolkits: XForms.
Ok, it was not really free, because you couldn't distribute patches.
And it was not all that good either, but we were comparing it with Motif, so it was much more free and much better than that monstrosity.
BTW: The latest release of XForms is from august of 2009.
At the time, a 25-year-old me was in love with Python 1.3. Here's how I described it:
- Python 1.3
It's a beautiful ,free, language. Get it from ftp://ftp.python.org http://www.python.org
Yes, Python 1.3. So, I wanted to use this C GUI toolkit used in this cool app, and this neat language I was learning and use them at the same time.
I ran (not walked) to my faithful Slackware 3.0 ELF in my 486DX2 PC and started hacking. In a weekend or so I had a working binding.
I even started writing the holy grail of desktop applications, a GUI version of Pine, using python and its IMAP module (python mailer, or PyM):
I released version 0.1 alpha in 1996, May 13 ... and a few months later Matthias Ettrich started KDE and I found Qt and never thought about XForms again.
Until this month.
For reasons that don't matter, I mentioned PyM in the PyAr mailing list the other day, and ... well, would pyxforms still work?
Why, pretty much, yeah!
I got the pyxforms-0.1-alpha sources from somewhere in the internet, installed XForms 1.0.92sp2 (yes, the latest release, from three months ago), of course I already had python 2.6.4 installed, added a setup.py, edited 10 lines of code and...
Yes, it works. You can get this 0.2 version (codename "Cthulhu was here") here just 13 years after 0.1.
No, I don't understand the weird rounded corners, or why the cursor looks weird and old when it's inside the window.
It's a REALLY small and fast toolkit, though.
Honestly, is it useful for ayone? Almost certainly not. Am I amazed something I wrote in 1996 still works? Oh, yeah I am.