Skip to content

Commit

Permalink
Merge pull request #54 from biscuit13161/master
Browse files Browse the repository at this point in the history
Added append redirect functionality
  • Loading branch information
tomerfiliba committed Feb 8, 2013
2 parents b6b62e5 + aa90a2f commit 112a7b1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plumbum/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ def __gt__(self, file):
"""Redirects the process' stdout to the given file"""
return StdoutRedirection(self, file)

def __rshift__(self, file):
"""Redirects the process' stdout to the given file (appending)"""
return AppendingStdoutRedirection(self, file)

def __ge__(self, file):
"""Redirects the process' stderr to the given file"""
return StderrRedirection(self, file)
Expand Down Expand Up @@ -421,6 +425,12 @@ class StdoutRedirection(BaseRedirection):
KWARG = "stdout"
MODE = "w"

class AppendingStdoutRedirection(BaseRedirection):
__slots__ = []
SYM = ">>"
KWARG = "stdout"
MODE = "a"

class StderrRedirection(BaseRedirection):
__slots__ = []
SYM = "2>"
Expand Down

0 comments on commit 112a7b1

Please sign in to comment.