libvcs icon indicating copy to clipboard operation
libvcs copied to clipboard

`run`: Move libvcs to new `SubprocessCommand`, document + test overriding

Open tony opened this issue 3 years ago • 0 comments
trafficstars

requires #337

  • run() should convert to Popen params for compatibility with SubprocessCommand

  • run() should support legacy_params (existing) to deprecate safely

class CommandPopenMixin:
    _run_fn = Subprocess.Popen


class CommandRunMixin:
    _run_fn = Subprocess.run

class Command:
    _run_fn = SubprocessCommand




class Command:
    _run_fn = SubprocessCommand

This turns git command into a subprocess command factory:

class Git(Command):
   ...


git_factory = Git(url='...')
status_cmd = git_factory.status()
status_cmd.run()
status_cmd.Popen()

Subprocess.Popen
Subprocess.run

tony avatar May 01 '22 12:05 tony