|
Do I know python? No, no I do not. Do I like coding in it? You bet your britches I do! Bet your britches...? Does anybody say that anymore? Well, I guess they do, since I just said it, but really, when did you last hear it said? Does anybody even wear britches anymore, and if they do, why would they want to bet them in th first place? Just to get another pair to wear over top their first pair? That would just be weird, and likely, uncomfortable. Now, once I figure out why I'm talking about wearing two pairs of britches at a time, I should be set. Anyways, enough about britches, and on to the point of this post: Python is like somesort of wonder drug after drudging my way around through C all semester. Messing around with it earlier in the semester (trying to learn DBus through a language you don't know is NOT a good way to do it), I was able to get a few things done, rather quickly. With this in mind, I set out to use it again, in the hopes of learning it, and using it to very quickly build up what I need done. I have not been let down.
I don't have the code on me for an accurate count right now, but doing this in another language has saved me likely a couple of hundred lines of C to do the same things, and as such, I almost have a daemon written. Down to business, my plans for the NetworkManager Automatic Web Authentication release 0.3: - Daemon listening for when NM connects to a network
- Grab the SSID from the connected network
- Pass it (via signal) to the Firefox extension
- Firefox extension opens a tab and goes to https://net1.senecac.on.ca and tries to submit the login information
So far, I have it waiting for NM to connect to a network, and when it does, the daemon will grab the information about it, and pull out the SSID, which it then prints. The main things left for me to figure out and implement are: - Sending a DBus signal in Python using an object path, interface, signal name, and string value
- Using Javascript in an extension to open a tab and go to a specific URL
- Submitting a form once the page is loaded
Although, really, I think the main point of this release is simply being able to pass the connection information to Firefox, and opening a tab as a result, whether it submits the info or not is a different story. I'll be posting the code thus far later on in the week, if anybody wants to test it out on their laptops or computers running Linux. |