Ataraxia Consulting

Peace of mind for consulting.

linode-api-python-part-2

Some of us are CLI junkies, and would prefer their hands never have to leave the keyboard to perform tasks. With that in mind I did a quick work up of an interactive shell for the API. One of the goals I had for the bindings was to introduce as few dependencies outside the core python libraries as possible, so the interactive console logically inherits from code.InteractiveConsole, which is for the most part a modified version of HistoryConsole from this example. The example claims that the console (presumably when used with .interact()) would have tab complete and history enabled. Much to my dismay and wasted time debugging, this is not the case. The reality is the console is sufficiently sandboxed (my guess) as to not inherit what you may setup of readline by the time you need it (as far as I could tell). The solution I came up with was to force my will upon the new interactive shell before the user enters it.

linode-api-python-part-1

The great Linode is preparing an api for customers to manipulate their account and twiddle their dns zone settings etc. Apparently I was supposed to write the Python bindings, the reality is somewhere between volunteer and victim I suspect. So I spent a little bit time working up an example how they might work.