Sorry for not getting to this yesterday, had to deal with some snow.
In any case, I think I'm done. See
pull request here.
A few caveats:
0) Haven't tested it yet (beyond that it compiles and that the generated C++ code properly dumps keys -- haven't tested the glue C++.) I'll get on that as time permits in the next day or two.
1) I'm especially unsure about
fc::datastream<const char*> stream(keys[i].c_str(), keys[i].size());
fc::sha256 bits;
stream >> bits;
keysRet.push_back(fc::ecc::private_key::regenerate(bits));
I took it from DerKorb's multibit wallet import implementation. In my case keys{i} is going to be a 51-character, starts-with-a-5 style uncompressed key -- but I haven't looked into whether that's what he was dealing with as well.
2) The cython-generated C++ file isn't very clean. I realized that a better way to do things than to make a minimal private key extractor from the electrum code would be to minimally modify the electrum code, thereby making it easier to keep the import function working should electrum change the way they handle wallets. In any case I added to vendor (wrong place, I know, there wasn't anywheres that fit too well) a makefile script and patch that lets one copy over the electrum lib directory and easily regenerate the C++ code.
3) I made the cmake file rely upon python 2.7.5
exactly. This isn't right, we just need python 2.x, but I cannot for the life of me figure out how to set a maximum (minimum required versions are easy) that cmake will find and it always goes for 3.3 on my system.