Closed juntalis closed 6 years ago
Hey there @juntalis! You should check out the devel branch https://github.com/mechboxes/mech/tree/devel.
A lot of rewrites and it should be compatible with Python 3. There are some unimplemented commands there too but it is a little more complicated to jump into than the master branch.
Woops - completely overlooked that branch. Will check it out and see if any of my changes still apply. In any case, closing this pull request.
Yes, please check devel branch. It’s not Python 3 compatible yet, we need to make it compatible though. We can either use six
or add a compat
module. Please make a new pull request for that branch if you can.
Not sure how you feel about maintaining Python 3 compatibility, but I figured I'd offer the changes and see if you want any of them. Let me know if you'd like me to split something out. Brief overview of the changes:
unpause
command so I added it in.--debug
wasn't being used for anything. Saw theDEBUG
field on theVmrun
class, so I linked them up.[options]
to thescp
command for consistency with thessh
command.RuntimeError
toVmrun
when it's unable to locate thevmrun
executable.rewrite_vmx
to resolve a Windows-specific issue: Not sure on the Python 2 behavior, but in Python 3, text mode resulted in theos.linesep
being replaced with a\r\r\n
.mech.compat
module)Mech.scp
method, the "download" logic branch can potentially run even whensrc_is_host
is False. (see example invocation below for details) I wasn't sure if this was behavior was intentional, so I suppressed the first character stripping whensrc_is_host == False
.would've previously tried to download
home/mech/file.txt
.Note: Tested each command in Python 2.7 and 3.6, but only on Windows. (didn't have a Linux dev environment handy when I was writing the changes)