Hi all. This month I decided to switch from a depth-first to breadth-first approach for overhauling arm. Changes included…
Made arm PEP8 compliant. This took around a week during which sed and I were close friends. Like Stem, both pyflakes and pep8 checks are now included in arm’s test runs.
Completely dropped tor_tools from the codebase. This is a neat milestone as tor_tools was a 2,700 line wrapper around TorCtl providing a friendlier API, thread safety, caching, etc. Stem provides all of these capabilities.
Initially migration was simply switching tor_tools from TorCtl to Stem, but now arm works directly with a Stem controller allowing us to drop the tor_tools module completely.
Finished arm’s new tracker module which provides tor resource usage, connections, and application names. It’s not just much nicer code, but now has unit tests!
Why am I sinking all this effort into arm? After all, it presently does pretty much what we want, right?
Well, yes. And I suspect user’s won’t see many obvious changes in the next arm release. Rather, my present focus on arm is partly for code quality but more importantly to make sure Stem is ready for prime time.
Arm and Vidalia are our two most complicated and demanding controller applications, and making a Stem-based arm release is a surprisingly good way of making sure Stem has all the pieces we need for tasks like a next-gen Tor GUI or a localhost status panel for relay operators.
As I’ve rewritten arm Stem has improved as well. Stem changes this month included…
Added a port_usage() function for getting a description of a port’s common usage. This nicely complements our other connection utils…
>>> from stem.util.connection import port_usage >>> port_usage(80) 'HTTP' >>> port_usage(22) 'SSH' >>> port_usage(9418) 'Git'
Couple new Controller methods to help with NEWNYM handling: is_newnym_available() and get_newnym_wait().
Pyflakes and pep8 are python modules so why shell out to them? We now use their APIs instead reduced the runtime of Stem’s static checks by 60%.
Greatly reduced the verbosity of stem’s test output. You can still get the previous, more detailed results with the ‘–verbose’ argument.
Last but not least, non-development tasks from this month included…