Sarge 0.1.8.dev0 documentation

Index

Index

Table Of Contents

  • Overview
    • What is Sarge for?
    • Why not just use subprocess?
    • Main features
    • Python version and platform compatibility
    • Project status
    • API stability
    • Change log
      • 0.1.8 (future)
      • 0.1.7
      • 0.1.6
      • 0.1.5
      • 0.1.4
      • 0.1.3
      • 0.1.2
      • 0.1.1
      • 0.1
    • Next steps
  • Tutorial
    • Installation and testing
    • Common usage patterns
      • Finding commands under Windows
      • Parsing commands under Windows
      • Chaining commands
      • Handling user input safely
      • Formatting commands with placeholders for safe usage
    • Passing input data to commands
      • Passing input data to commands dynamically
    • Chaining commands conditionally
    • Creating command pipelines
    • Using redirection
    • Capturing stdout and stderr from commands
    • Iterating over captures
    • Interacting with child processes
      • Buffering issues
      • Looking for specific patterns in child process output
      • Displaying progress as a child process runs
      • Direct terminal usage
    • Environments
    • Working directory and other options
    • Unicode and bytes
    • Use as context managers
    • Synchronous and asynchronous execution of commands
    • Handling errors in asynchronous mode
    • About threading and forking on POSIX
    • Next steps
  • Under the hood
    • How capturing works
      • Basic approach
      • Blocking and timeouts
      • Implications when handling large amounts of data
    • Swapping output streams
    • How shell quoting works
    • How shell command formatting works
    • How command parsing works
    • Thread debugging
    • Future changes
    • Next steps
  • API Reference
    • Attributes
      • default_capture_timeout
    • Functions
      • run()
      • capture_stdout()
      • get_stdout()
      • capture_stderr()
      • get_stderr()
      • capture_both()
      • get_both()
      • shell_quote()
      • shell_format()
    • Classes
      • Command
        • Command.process
        • Command.returncode
        • Command.exception
        • Command.run()
        • Command.wait()
        • Command.terminate()
        • Command.kill()
        • Command.poll()
      • Pipeline
        • Pipeline.returncodes
        • Pipeline.returncode
        • Pipeline.commands
        • Pipeline.exceptions
        • Pipeline.run()
        • Pipeline.wait()
        • Pipeline.poll_last()
        • Pipeline.poll_all()
        • Pipeline.close()
      • Capture
        • Capture.read()
        • Capture.readline()
        • Capture.readlines()
        • Capture.expect()
      • Popen
    • Shell syntax understood by sarge
      • Command syntax
      • Redirections
    • Next steps
  • Overview
    • What is Sarge for?
    • Why not just use subprocess?
    • Main features
    • Python version and platform compatibility
    • Project status
    • API stability
    • Change log
      • 0.1.8 (future)
      • 0.1.7
      • 0.1.6
      • 0.1.5
      • 0.1.4
      • 0.1.3
      • 0.1.2
      • 0.1.1
      • 0.1
    • Next steps
  • Tutorial
    • Installation and testing
    • Common usage patterns
      • Finding commands under Windows
      • Parsing commands under Windows
      • Chaining commands
      • Handling user input safely
      • Formatting commands with placeholders for safe usage
    • Passing input data to commands
      • Passing input data to commands dynamically
    • Chaining commands conditionally
    • Creating command pipelines
    • Using redirection
    • Capturing stdout and stderr from commands
    • Iterating over captures
    • Interacting with child processes
      • Buffering issues
      • Looking for specific patterns in child process output
      • Displaying progress as a child process runs
      • Direct terminal usage
    • Environments
    • Working directory and other options
    • Unicode and bytes
    • Use as context managers
    • Synchronous and asynchronous execution of commands
    • Handling errors in asynchronous mode
    • About threading and forking on POSIX
    • Next steps
  • Under the hood
    • How capturing works
      • Basic approach
      • Blocking and timeouts
      • Implications when handling large amounts of data
    • Swapping output streams
    • How shell quoting works
    • How shell command formatting works
    • How command parsing works
    • Thread debugging
    • Future changes
    • Next steps
  • API Reference
    • Attributes
      • default_capture_timeout
    • Functions
      • run()
      • capture_stdout()
      • get_stdout()
      • capture_stderr()
      • get_stderr()
      • capture_both()
      • get_both()
      • shell_quote()
      • shell_format()
    • Classes
      • Command
        • Command.process
        • Command.returncode
        • Command.exception
        • Command.run()
        • Command.wait()
        • Command.terminate()
        • Command.kill()
        • Command.poll()
      • Pipeline
        • Pipeline.returncodes
        • Pipeline.returncode
        • Pipeline.commands
        • Pipeline.exceptions
        • Pipeline.run()
        • Pipeline.wait()
        • Pipeline.poll_last()
        • Pipeline.poll_all()
        • Pipeline.close()
      • Capture
        • Capture.read()
        • Capture.readline()
        • Capture.readlines()
        • Capture.expect()
      • Popen
    • Shell syntax understood by sarge
      • Command syntax
      • Redirections
    • Next steps

Index

C | D | E | G | K | P | R | S | T | W

C

  • Capture (class in sarge)
  • capture_both() (in module sarge)
  • capture_stderr() (in module sarge)
  • capture_stdout() (in module sarge)
  • close() (Pipeline method)
  • Command (class in sarge)
  • commands (Pipeline attribute)

D

  • default_capture_timeout (in module sarge)

E

  • exception (Command attribute)
  • exceptions (Pipeline attribute)
  • expect() (Capture method)

G

  • get_both() (in module sarge)
  • get_stderr() (in module sarge)
  • get_stdout() (in module sarge)

K

  • kill() (Command method)

P

  • Pipeline (class in sarge)
  • poll() (Command method)
  • poll_all() (Pipeline method)
  • poll_last() (Pipeline method)
  • Popen (class in sarge)
  • process (Command attribute)

R

  • read() (Capture method)
  • readline() (Capture method)
  • readlines() (Capture method)
  • returncode (Command attribute)
    • (Pipeline attribute)
  • returncodes (Pipeline attribute)
  • run() (Command method)
    • (in module sarge)
    • (Pipeline method)

S

  • shell_format() (in module sarge)
  • shell_quote() (in module sarge)

T

  • terminate() (Command method)

W

  • wait() (Command method)
    • (Pipeline method)
© Copyright 2012-2023, Vinay Sajip. Built with Sphinx 5.3.0 and the Sizzle theme.